Skip to content

Commit

Permalink
chore: refactor and lint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytelife26 committed Jul 11, 2021
1 parent cc1f537 commit 433fc0b
Show file tree
Hide file tree
Showing 88 changed files with 7 additions and 94 deletions.
2 changes: 1 addition & 1 deletion tests/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ def wpe_too_high(self):

# Make sure that
assert wpe > min_wpe, \
"{} has only {} wpe.".format(example, round(wpe, 2))
f"{example} has only {round(wpe, 2)} wpe."
1 change: 0 additions & 1 deletion tests/test_annotations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for annotations.misc check."""
from __future__ import absolute_import

from proselint.checks.annotations import misc as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_archaism.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for archaism.misc check."""
from __future__ import absolute_import

from proselint.checks.archaism import misc as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_butterick_symbols.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Test Butterick's symbols."""
from __future__ import absolute_import

from proselint.checks.typography import symbols as chk

Expand Down
3 changes: 1 addition & 2 deletions tests/test_clear_cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Tests for the clear cache operation from proselint.command_line."""

import os
Expand All @@ -10,7 +9,7 @@
from unittest import mock
except ImportError:
# Py2.x
import mock
from unittest import mock

try:
from builtins import PermissionError
Expand Down
1 change: 0 additions & 1 deletion tests/test_cliches.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Test the Cliches.misc module."""
from __future__ import absolute_import

from proselint.checks.cliches import misc as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_consistency_check.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Test the consistency_check function from the tools.py module."""
from __future__ import absolute_import

from proselint.tools import consistency_check as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_consistency_spacing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for consistency.spacing check."""
from __future__ import absolute_import

from proselint.checks.consistency import spacing as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_consistency_spelling.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for consistency.spelling check."""
from __future__ import absolute_import

from proselint.checks.consistency import spelling as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_corporate_speak.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for corporate_speak.misc check."""
from __future__ import absolute_import

from proselint.checks.corporate_speak import misc as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_cursing_filth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for cursing.filth check."""
from __future__ import absolute_import

from proselint.checks.cursing import filth as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_cursing_nfl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for cursing.nfl check."""
from __future__ import absolute_import

from proselint.checks.cursing import nfl as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_cursing_nword.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for cursing.nword check."""
from __future__ import absolute_import

from proselint.checks.cursing import nword as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_dates_times_dates.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for dates_times.dates check."""
from __future__ import absolute_import

from proselint.checks.dates_times import dates as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_garner_dates.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Test garner.dates."""
from __future__ import absolute_import, print_function

from proselint.checks.dates_times import dates

Expand Down
7 changes: 3 additions & 4 deletions tests/test_gmeu/test_a_A.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Test GMEU entry 'a', part A."""

from __future__ import absolute_import

from proselint.tools import assert_error

from tests.check import Check


Expand Down Expand Up @@ -35,7 +34,7 @@ def this_check(self):
"Out of 186 managers participating, 57 had a MBA degree.",
"Smith announced that a SEC filing is pending.",
"This argument is an historical desecration.",
u"The treatment of crime in Britain shows an historic shift away…",
"The treatment of crime in Britain shows an historic shift away…",
"It is, in some ways, an humble form.",
"The thief turned out to be an habitual offender from Darlington.",
"This stage displays an hallucinatory image that signifies itself.",
Expand All @@ -53,5 +52,5 @@ def this_check(self):
]

def test_smoke(self):
for sentence in sentences_with_errors:
for sentence in self.sentences_with_errors:
assert not self.passes(sentence)
3 changes: 1 addition & 2 deletions tests/test_gmeu/test_a_B.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Test GMEU entry 'a', part B."""

from __future__ import absolute_import

from proselint.tools import assert_error

from tests.check import Check


Expand Down
1 change: 0 additions & 1 deletion tests/test_gmeu/test_a_C.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Test GMEU entry 'a', part C.
Expand Down
1 change: 0 additions & 1 deletion tests/test_hedging.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for hedging.misc check."""
from __future__ import absolute_import

from proselint.checks.hedging import misc as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_hyperbole.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for hyperbole.misc check."""
from __future__ import absolute_import

from proselint.checks.hyperbole import misc as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_jargon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for jargon.misc check."""
from __future__ import absolute_import

from proselint.checks.jargon import misc as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_leonard.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Test garner.dates."""
from __future__ import absolute_import, print_function

from proselint.checks.typography import exclamation

Expand Down
1 change: 0 additions & 1 deletion tests/test_lexical_illusions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for lexical_illusions.misc check."""
from __future__ import absolute_import

from proselint.checks.lexical_illusions import misc as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_lgbtq_offensive_terms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for lgbtq.terms check."""
from __future__ import absolute_import

from proselint.checks.lgbtq import offensive_terms as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_lgbtq_terms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for lgbtq.offensive_terms check."""
from __future__ import absolute_import

from proselint.checks.lgbtq import terms as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_malaproprisms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for malaproprisms.misc check."""
from __future__ import absolute_import

from proselint.checks.malapropisms import misc as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_apologizing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.apologizing check."""
from __future__ import absolute_import

from proselint.checks.misc import apologizing as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_back_formations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.back_formations check."""
from __future__ import absolute_import

from proselint.checks.misc import back_formations as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_bureaucratese.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.bureaucratese check."""
from __future__ import absolute_import

from proselint.checks.misc import bureaucratese as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_but.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.but check."""
from __future__ import absolute_import

from proselint.checks.misc import but as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_capitalization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.capitalization check."""
from __future__ import absolute_import

from proselint.checks.misc import capitalization as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_chatspeak.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.chatspeak check."""
from __future__ import absolute_import

from proselint.checks.misc import chatspeak as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_commercialese.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.commercialese check."""
from __future__ import absolute_import

from proselint.checks.misc import commercialese as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_composition.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.composition check."""
from __future__ import absolute_import

from proselint.checks.misc import composition as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_currency.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.currency check."""
from __future__ import absolute_import

from proselint.checks.misc import currency as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_debased.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.debased check."""
from __future__ import absolute_import

from proselint.checks.misc import debased as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_false_plurals.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.false_plurals check."""
from __future__ import absolute_import

from proselint.checks.misc import false_plurals as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_greylist.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.greylist check."""
from __future__ import absolute_import

from proselint.checks.misc import greylist as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_illogic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.illogic check."""
from __future__ import absolute_import

from proselint.checks.misc import illogic as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_inferior_superior.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.inferior_superior check."""
from __future__ import absolute_import

from proselint.checks.misc import inferior_superior as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_latin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.latin check."""
from __future__ import absolute_import

from proselint.checks.misc import latin as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_many_a.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.many_a check."""
from __future__ import absolute_import

from proselint.checks.misc import many_a as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_metaconcepts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.metaconcepts check."""
from __future__ import absolute_import

from proselint.checks.misc import metaconcepts as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_metadiscourse.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.metadiscourse check."""
from __future__ import absolute_import

from proselint.checks.misc import metadiscourse as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_narcissism.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.narcissism check."""
from __future__ import absolute_import

from proselint.checks.misc import narcissism as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_not_guilty.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.not_guilty check."""
from __future__ import absolute_import

from proselint.checks.misc import not_guilty as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_phrasal_adjectives.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.phrasal_adjectives check."""
from __future__ import absolute_import

from proselint.checks.misc import phrasal_adjectives as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_preferred_forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.preferred_forms check."""
from __future__ import absolute_import

from proselint.checks.misc import preferred_forms as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_pretension.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.pretension check."""
from __future__ import absolute_import

from proselint.checks.misc import pretension as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_professions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.professions check."""
from __future__ import absolute_import

from proselint.checks.misc import professions as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_punctuation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.punctuation check."""
from __future__ import absolute_import

from proselint.checks.misc import punctuation as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_scare_quotes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.scare_quotes check."""
from __future__ import absolute_import

from proselint.checks.misc import scare_quotes as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_suddenly.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.suddenly check."""
from __future__ import absolute_import

from proselint.checks.misc import suddenly as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_tense_present.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.tense_present check."""
from __future__ import absolute_import

from proselint.checks.misc import tense_present as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_usage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.usage check."""
from __future__ import absolute_import

from proselint.checks.misc import usage as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_waxed.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.waxed check."""
from __future__ import absolute_import

from proselint.checks.misc import waxed as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_misc_whence.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for misc.whence check."""
from __future__ import absolute_import

from proselint.checks.misc import whence as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_mixed_metaphors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for mixed_metaphors.misc check."""
from __future__ import absolute_import

from proselint.checks.mixed_metaphors import misc as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_mondegreens.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for mondegreens.misc check."""
from __future__ import absolute_import

from proselint.checks.mondegreens import misc as chk

Expand Down
1 change: 0 additions & 1 deletion tests/test_needless_variants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for needless_variants.misc check."""
from __future__ import absolute_import

from proselint.checks.needless_variants import misc as chk

Expand Down
Loading

0 comments on commit 433fc0b

Please sign in to comment.