diff options
author | Eric Smith <eric@trueblade.com> | 2009-02-06 01:32:42 (GMT) |
---|---|---|
committer | Eric Smith <eric@trueblade.com> | 2009-02-06 01:32:42 (GMT) |
commit | 0e5b562987303912f8236bfe90c5bf0f093d8d63 (patch) | |
tree | 04b1efe719cd278576fed77695135d01dcfb6b0e /Lib | |
parent | d3409deddc7fc24171514debf2ab2128e337d97d (diff) | |
download | cpython-0e5b562987303912f8236bfe90c5bf0f093d8d63.zip cpython-0e5b562987303912f8236bfe90c5bf0f093d8d63.tar.gz cpython-0e5b562987303912f8236bfe90c5bf0f093d8d63.tar.bz2 |
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.
........
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_sys.py | 14 |
1 files changed, 13 insertions, 1 deletions
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 @@ class SysModuleTest(unittest.TestCase): 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 |