Merged revisions 69331 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r69331 | eric.smith | 2009-02-05 19:48:26 -0500 (Thu, 05 Feb 2009) | 2 lines
Implement issue #4285, convert sys.version_info to a named
tuple. Patch by Ross Light.
........
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 7655fbf..fad9939 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -298,13 +298,25 @@
self.assert_(isinstance(sys.prefix, str))
self.assert_(isinstance(sys.version, str))
vi = sys.version_info
- self.assert_(isinstance(vi, tuple))
+ self.assert_(isinstance(vi[:], tuple))
self.assertEqual(len(vi), 5)
self.assert_(isinstance(vi[0], int))
self.assert_(isinstance(vi[1], int))
self.assert_(isinstance(vi[2], int))
self.assert_(vi[3] in ("alpha", "beta", "candidate", "final"))
self.assert_(isinstance(vi[4], int))
+ self.assert_(isinstance(vi.major, int))
+ self.assert_(isinstance(vi.minor, int))
+ self.assert_(isinstance(vi.micro, int))
+ self.assert_(vi.releaselevel in
+ ("alpha", "beta", "candidate", "final"))
+ self.assert_(isinstance(vi.serial, int))
+ self.assertEqual(vi[0], vi.major)
+ self.assertEqual(vi[1], vi.minor)
+ self.assertEqual(vi[2], vi.micro)
+ self.assertEqual(vi[3], vi.releaselevel)
+ self.assertEqual(vi[4], vi.serial)
+ self.assert_(vi > (1,0,0))
def test_43581(self):
# Can't use sys.stdout, as this is a StringIO object when