Skip to content

Commit c4b85dc

Browse files
committed
Do not assume 'coverage' uses Python 2
Also clean up warnings about 'imp' again, and drop a conditional for very old Python 2 versions.
1 parent 1899b6a commit c4b85dc

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ preview-pypi-description:
5858

5959
.PHONY: coverage
6060
coverage:
61-
coverage run --source=objgraph tests.py
61+
python2 -m coverage run --source=objgraph tests.py
6262
python3 -m coverage run -a --source=objgraph tests.py
6363
coverage report -m --fail-under=100
6464

tests.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
import types
1313
import unittest
1414

15-
# distutils imports `imp`, which triggers a DeprecationWarning starting with
15+
# setuptools imports `imp`, which triggers a DeprecationWarning starting with
1616
# Python 3.4 in the middle of my pristine test suite. But if I do the import
1717
# upfront, there's no warning. I cannot explain this, I'm just happy there's
1818
# no warning.
19-
import distutils # noqa
19+
import setuptools # noqa
2020

2121
try:
2222
from unittest import mock
@@ -478,8 +478,6 @@ def test_gradient_empty(self):
478478
(0.2, 0.3, 0.4), 0, 0))
479479

480480
@skipIf(sys.version_info[0] > 2, "Python 3 has no unbound methods")
481-
@skipIf(sys.version_info[:2] < (2, 6),
482-
"Python 2.5 and older has no __func__")
483481
def test_edge_label_unbound_method(self):
484482
class MyClass(object):
485483
def a_method(self):

0 commit comments

Comments
 (0)