-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #643 from megies/pep8_tests
add a test case that checks for pep8 compliance
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import unittest | ||
from matplotlib.tests.test_coding_standards import test_pep8_conformance | ||
import obspy | ||
|
||
EXCLUDE_FILES = [] | ||
EXPECTED_BAD_FILES = [ | ||
"*/obspy/lib/__init__.py", | ||
] | ||
PEP8_ADDITONAL_IGNORE = [] | ||
|
||
try: | ||
import pep8 | ||
except ImportError: | ||
HAS_PEP8 = False | ||
else: | ||
HAS_PEP8 = pep8.__version__ > '1.4.5' | ||
|
||
if HAS_PEP8: | ||
from matplotlib.tests.test_coding_standards import \ | ||
StandardReportWithExclusions | ||
StandardReportWithExclusions.expected_bad_files = EXPECTED_BAD_FILES | ||
|
||
|
||
class Pep8TestCase(unittest.TestCase): | ||
""" | ||
Test codebase for Pep8 compliance. | ||
""" | ||
def test_pep8(self): | ||
""" | ||
Test codebase for Pep8 compliance. | ||
""" | ||
test_pep8_conformance(module=obspy, exclude_files=EXCLUDE_FILES, | ||
extra_exclude_file=None, | ||
pep8_additional_ignore=PEP8_ADDITONAL_IGNORE) | ||
|
||
|
||
def suite(): | ||
return unittest.makeSuite(Pep8TestCase, 'test') | ||
|
||
|
||
if __name__ == '__main__': | ||
if not HAS_PEP8: | ||
raise unittest.SkipTest('pep8 is required for this test suite') | ||
unittest.main(defaultTest='suite') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters