Skip to content

Commit

Permalink
Merge pull request #339 from pv/setup-test-fix
Browse files Browse the repository at this point in the history
Fix setup.py test for setuptools 18.4
  • Loading branch information
pv committed Oct 18, 2015
2 parents ed58613 + d8da465 commit de04214
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,23 @@ def initialize_options(self):

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

# The following is required for setuptools<18.4
try:
self.test_args = []
except AttributeError:
# fails on setuptools>=18.4
pass
self.test_suite = 'unused'

def run_tests(self):
import pytest
test_args = ['test']
if self.pytest_args:
self.test_args += self.pytest_args.split()
test_args += self.pytest_args.split()
if self.coverage:
self.test_args += ['--cov', 'asv']
errno = pytest.main(self.test_args)
test_args += ['--cov', 'asv']
errno = pytest.main(test_args)
sys.exit(errno)


Expand Down

0 comments on commit de04214

Please sign in to comment.