summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-12-13 17:21:58 -0500
committerNed Batchelder <ned@nedbatchelder.com>2009-12-13 17:21:58 -0500
commit5e5c26966ee3d75c17ca33c9d49f8926aefe735b (patch)
tree96e9e9a8550523a6ade00967c823f875d207e330 /test
parent9e134e3f40f34a560860efdb48874f8332629ba4 (diff)
downloadpython-coveragepy-git-5e5c26966ee3d75c17ca33c9d49f8926aefe735b.tar.gz
version_info is a nicer way to check Python versions than hexversion is.
Diffstat (limited to 'test')
-rw-r--r--test/osinfo.py2
-rw-r--r--test/test_arcs.py4
-rw-r--r--test/test_coverage.py8
-rw-r--r--test/test_oddball.py2
4 files changed, 8 insertions, 8 deletions
diff --git a/test/osinfo.py b/test/osinfo.py
index 8bed2afd..04855fe6 100644
--- a/test/osinfo.py
+++ b/test/osinfo.py
@@ -2,7 +2,7 @@
import sys
-if sys.hexversion >= 0x02050000 and sys.platform == 'win32':
+if sys.version_info >= (2, 5) and sys.platform == 'win32':
# Windows implementation
def process_ram():
"""How much RAM is this process using? (Windows)"""
diff --git a/test/test_arcs.py b/test/test_arcs.py
index 45ab27e8..cbd7645d 100644
--- a/test/test_arcs.py
+++ b/test/test_arcs.py
@@ -212,7 +212,7 @@ class LoopArcTest(CoverageTest):
)
# With "while True", 2.x thinks it's computation, 3.x thinks it's
# constant.
- if sys.hexversion >= 0x03000000:
+ if sys.version_info >= (3, 0):
arcz = ".1 12 23 34 45 36 63 57 27 7."
else:
arcz = ".1 12 23 34 45 36 62 57 27 7."
@@ -387,7 +387,7 @@ class ExceptionArcTest(CoverageTest):
arcz=".1 12 23 34 3D 45 56 67 68 7A 8A A3 AB AD BC CD D.",
arcz_missing="3D AB BC CD", arcz_unpredicted="")
- if sys.hexversion >= 0x02050000:
+ if sys.version_info >= (2, 5):
# Try-except-finally was new in 2.5
def test_except_finally(self):
self.check_coverage("""\
diff --git a/test/test_coverage.py b/test/test_coverage.py
index 9303c063..693b9b33 100644
--- a/test/test_coverage.py
+++ b/test/test_coverage.py
@@ -212,7 +212,7 @@ class SimpleStatementTest(CoverageTest):
""",
[1,2,3,6,9], "")
- if sys.hexversion < 0x03000000: # Print statement is gone in Py3k.
+ if sys.version_info < (3, 0): # Print statement is gone in Py3k.
def testPrint(self):
self.check_coverage("""\
print "hello, world!"
@@ -403,7 +403,7 @@ class SimpleStatementTest(CoverageTest):
""",
[1,2,3,4,5], "")
- if sys.hexversion < 0x03000000:
+ if sys.version_info < (3, 0):
# In Python 2.x, exec is a statement.
def testExec(self):
self.check_coverage("""\
@@ -1393,7 +1393,7 @@ class ExcludeTest(CoverageTest):
[8,9], "", ['#pragma: NO COVER'])
-if sys.hexversion >= 0x020400f0:
+if sys.version_info >= (2, 4):
class Py24Test(CoverageTest):
"""Tests of new syntax in Python 2.4."""
@@ -1464,7 +1464,7 @@ if sys.hexversion >= 0x020400f0:
[1,2,3,4,5,7,8,9,10,11,12,14, 17,19,21, 24,26]), "")
-if sys.hexversion >= 0x020500f0:
+if sys.version_info >= (2, 5):
class Py25Test(CoverageTest):
"""Tests of new syntax in Python 2.5."""
diff --git a/test/test_oddball.py b/test/test_oddball.py
index b102019b..a40fb4c8 100644
--- a/test/test_oddball.py
+++ b/test/test_oddball.py
@@ -245,7 +245,7 @@ class ExceptionTest(CoverageTest):
self.assertEqual(clean_lines, lines_expected)
-if sys.hexversion > 0x02050000:
+if sys.version_info >= (2, 5):
class DoctestTest(CoverageTest):
"""Tests invoked with doctest should measure properly."""