summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-06-13 07:57:18 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-06-13 07:57:18 -0400
commit3240e331e8e6fb5cf56991d28c5279138df2466e (patch)
tree36c88664bb7d45dfc90fe974c799cdcbe552f117 /tests
parent8487f53182564a40d8283d1433ce16cfdf921059 (diff)
downloadpython-coveragepy-3240e331e8e6fb5cf56991d28c5279138df2466e.tar.gz
Make version checking more uniform
Diffstat (limited to 'tests')
-rw-r--r--tests/test_farm.py2
-rw-r--r--tests/test_parser.py2
-rw-r--r--tests/test_process.py4
3 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_farm.py b/tests/test_farm.py
index 8368126..4fc0ea5 100644
--- a/tests/test_farm.py
+++ b/tests/test_farm.py
@@ -36,7 +36,7 @@ def test_farm(filename):
# "rU" was deprecated in 3.4
-READ_MODE = "rU" if sys.version_info < (3, 4) else "r"
+READ_MODE = "rU" if env.PYVERSION < (3, 4) else "r"
class FarmTestCase(ModuleAwareMixin, SysPathAwareMixin, unittest.TestCase):
diff --git a/tests/test_parser.py b/tests/test_parser.py
index 034e9aa..169319f 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -200,7 +200,7 @@ class PythonParserTest(CoverageTest):
expected_arcs = set(self.arcz_to_arcs(".1 14 48 8. .2 2. -8A A-8"))
expected_exits = {1: 1, 2: 1, 4: 1, 8: 1, 10: 1}
if env.PYVERSION >= (3, 7, 0, 'beta', 5):
- # 3.7 changed how functions with only docstrings were numbered.
+ # 3.7 changed how functions with only docstrings are numbered.
expected_arcs.update(set(self.arcz_to_arcs("-46 6-4")))
expected_exits.update({6: 1})
self.assertEqual(parser.arcs(), expected_arcs)
diff --git a/tests/test_process.py b/tests/test_process.py
index f0b1cde..7e55c77 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -659,7 +659,7 @@ class ProcessTest(CoverageTest):
self.assertGreater(data.line_counts()['os.py'], 50)
def test_lang_c(self):
- if env.PY3 and sys.version_info < (3, 4):
+ if env.PY3 and env.PYVERSION < (3, 4):
# Python 3.3 can't compile the non-ascii characters in the file name.
self.skipTest("3.3 can't handle this test")
if env.JYTHON:
@@ -768,7 +768,7 @@ class EnvironmentTest(CoverageTest):
self.assert_tryexecfile_output(out_cov, out_py)
def test_coverage_run_dir_is_like_python_dir(self):
- if sys.version_info == (3, 5, 4, 'final', 0): # pragma: obscure
+ if env.PYVERSION == (3, 5, 4, 'final', 0): # pragma: obscure
self.skipTest("3.5.4 broke this: https://bugs.python.org/issue32551")
with open(TRY_EXECFILE) as f:
self.make_file("with_main/__main__.py", f.read())