Skip to content

Commit

Permalink
encapsulated special handling
Browse files Browse the repository at this point in the history
  • Loading branch information
FND committed Sep 7, 2013
1 parent e499632 commit 161f015
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ python:
- 2.7

install:
- python setup.py develop
- pip install --use-mirrors \
`python -c 'from setup import META; print " ".join(META["extras_require"]["testing"] + META["install_requires"])'`
- pip install coveralls
- python setup.py develop

script:
- make remotes
Expand Down
35 changes: 19 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@
__license__ as LICENSE, __doc__ as DESC)


class PyTest(TestCommand):

def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True

def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)


META = {
'name': 'tiddlywebplugins.bfw',
'url': 'https://github.com/FND/tiddlywebplugins.bfw',
Expand All @@ -43,11 +30,27 @@ def run_tests(self):
'extras_require': {
'testing': ['pytest', 'wsgi-intercept', 'httplib2'],
'coverage': ['figleaf', 'coverage']
},
'tests_require': ['pytest'],
'cmdclass': { 'test': PyTest }
}
}


# entry point for tests (required because `coverage` fails to invoke `py.test`
# in Travis CI's virtualenv)

class PyTest(TestCommand):

def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True

def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)

META['cmdclass'] = { 'test': PyTest }


if __name__ == '__main__':
setup(**META)

0 comments on commit 161f015

Please sign in to comment.