[Python-checkins] r74641 - in python/branches/py3k: Lib/test/test_platform.py

brett.cannon python-checkins at python.org
Thu Sep 3 23:29:20 CEST 2009


Author: brett.cannon
Date: Thu Sep 3 23:29:20 2009
New Revision: 74641
Log:
Merged revisions 74640 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk
........
 r74640 | brett.cannon | 2009年09月03日 14:25:21 -0700 (2009年9月03日) | 7 lines
 
 test_platform fails on OS X Snow Leopard because the UNIX command to get the
 canonical version, sw_vers, leaves off trailing zeros in the version number
 (e.g. 10.6 instead of 10.6.0). Test now compensates by tacking on extra zeros
 for the test comparison.
 
 Fixes issue #6806.
........
Modified:
 python/branches/py3k/ (props changed)
 python/branches/py3k/Lib/test/test_platform.py
Modified: python/branches/py3k/Lib/test/test_platform.py
==============================================================================
--- python/branches/py3k/Lib/test/test_platform.py	(original)
+++ python/branches/py3k/Lib/test/test_platform.py	Thu Sep 3 23:29:20 2009
@@ -149,7 +149,13 @@
 break
 fd.close()
 self.assertFalse(real_ver is None)
- self.assertEquals(res[0], real_ver)
+ result_list = res[0].split('.')
+ expect_list = real_ver.split('.')
+ len_diff = len(result_list) - len(expect_list)
+ # On Snow Leopard, sw_vers reports 10.6.0 as 10.6
+ if len_diff > 0:
+ expect_list.extend(['0'] * len_diff)
+ self.assertEquals(result_list, expect_list)
 
 # res[1] claims to contain
 # (version, dev_stage, non_release_version)


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /