Skip to content

Commit

Permalink
Simplify forgotten debug statement test
Browse files Browse the repository at this point in the history
  • Loading branch information
brunato committed Oct 20, 2021
1 parent 28f5aa3 commit 60f0bc8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ def setUpClass(cls):
)
cls.get_version = re.compile(r"(?:\brelease|__version__)(?:\s*=\s*)(\'[^\']*\'|\"[^\"]*\")")

def test_missing_debug_statements(self):
def test_forgotten_debug_statements(self):
# Exclude explicit debug statements written in the code
exclude = {
'regex.py': [240, 241],
'codepoints.py': [534],
'cli.py': [117, 133, 137, 140],
'cli.py': ['print('],
}

message = "\nFound a debug missing statement at line %d or file %r: %r"
Expand All @@ -54,7 +52,7 @@ def test_missing_debug_statements(self):
continue

match = self.missing_debug.search(line)
if match is None or filename.endswith('/cli.py') and match.group(0) == 'print(':
if match is None or match.group(0) in file_excluded:
continue
self.assertIsNone(match, message % (lineno, filename, match.group(0)))

Expand Down

0 comments on commit 60f0bc8

Please sign in to comment.