Skip to content

Commit

Permalink
Convert tox to run the coverage command, like travis.
Browse files Browse the repository at this point in the history
Fixes #87
  • Loading branch information
jamadden committed Jun 9, 2017
1 parent 2f70703 commit b752e80
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/zope/interface/tests/test_adapter.py
Expand Up @@ -1390,7 +1390,7 @@ def test__normalize_name_str(self):
STR = b'str'
if sys.version_info[0] < 3:
self.assertEqual(_normalize_name(STR), unicode(STR))
else:
else: # pragma: no cover (tox runs coverage on Python 2)
self.assertEqual(_normalize_name(STR), str(STR, 'ascii'))

def test__normalize_name_unicode(self):
Expand Down
6 changes: 3 additions & 3 deletions src/zope/interface/tests/test_advice.py
Expand Up @@ -221,7 +221,7 @@ class Meta(type):
self.assertEqual(self._callFUT((Meta, type)), Metameta)

@_skip_under_py2
def test_meta_of_class_py3k(self):
def test_meta_of_class_py3k(self): # pragma: no cover (tox runs coverage on Python 2)
# Work around SyntaxError under Python2.
EXEC = '\n'.join([
'class Metameta(type):',
Expand Down Expand Up @@ -249,7 +249,7 @@ class B(type):
self.assertEqual(self._callFUT((A, B,)), Meta_B)

@_skip_under_py2
def test_multiple_in_hierarchy_py3k(self):
def test_multiple_in_hierarchy_py3k(self): # pragma: no cover (tox runs coverage on Python 2)
# Work around SyntaxError under Python2.
EXEC = '\n'.join([
'class Meta_A(type):',
Expand Down Expand Up @@ -282,7 +282,7 @@ class B(type):
self.assertRaises(TypeError, self._callFUT, (A, B,))

@_skip_under_py2
def test_multiple_not_in_hierarchy_py3k(self):
def test_multiple_not_in_hierarchy_py3k(self): # pragma: no cover (tox runs coverage on Python 2)
# Work around SyntaxError under Python2.
EXEC = '\n'.join([
'class Meta_A(type):',
Expand Down
4 changes: 2 additions & 2 deletions src/zope/interface/tests/test_declarations.py
Expand Up @@ -31,7 +31,7 @@ def _run_generated_code(self, code, globs, locs,
exec(code, globs, locs)
self.assertEqual(len(log), 0) # no longer warn
return True
else:
else: # pragma: no cover (tox runs coverage on Python 2)
try:
exec(code, globs, locs)
except TypeError:
Expand Down Expand Up @@ -752,7 +752,7 @@ def test_simple(self):
warnings.resetwarnings()
try:
exec(CODE, globs, locs)
except TypeError:
except TypeError: # pragma: no cover (tox runs coverage on Python 2)
if not PYTHON3:
raise
else:
Expand Down
5 changes: 2 additions & 3 deletions tox.ini
Expand Up @@ -28,12 +28,11 @@ usedevelop = true
basepython =
python2.7
commands =
nosetests --with-xunit --with-xcoverage {posargs}
coverage run setup.py -q test -q {posargs}
coverage report --skip-covered
deps =
{[testenv]deps}
nose
coverage
nosexcover

[testenv:docs]
basepython =
Expand Down

0 comments on commit b752e80

Please sign in to comment.