Skip to content

Commit

Permalink
Merge 486c46d into 06cd031
Browse files Browse the repository at this point in the history
  • Loading branch information
megies committed Oct 2, 2013
2 parents 06cd031 + 486c46d commit 973fd18
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ before_install:
- pip install https://github.com/yarikoptic/coveralls-python/archive/master.zip
- pip install geographiclib
- pip install --use-mirrors matplotlib==1.3.0
- pip install --use-mirrors --upgrade pep8
install:
- git remote add obspy git://github.com/obspy/obspy.git
- git fetch obspy --tags
Expand Down
46 changes: 46 additions & 0 deletions obspy/core/tests/test_pep8.py
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')
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
'lxml',
'sqlalchemy',
'suds>=0.4.0']
EXTRAS_REQUIRE = {
'tests': ['pep8']}
ENTRY_POINTS = {
'console_scripts': [
'obspy-runtests = obspy.core.scripts.runtests:main',
Expand Down Expand Up @@ -479,6 +481,7 @@ def setupPackage():
namespace_packages=[],
zip_safe=False,
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
download_url=("https://github.com/obspy/obspy/zipball/master"
"#egg=obspy=dev"), # this is needed for "easy_install obspy==dev"
include_package_data=True,
Expand Down

0 comments on commit 973fd18

Please sign in to comment.