[Python-checkins] r84137 - python/branches/py3k/Lib/test/test_dis.py
nick.coghlan
python-checkins at python.org
Tue Aug 17 11:25:57 CEST 2010
Author: nick.coghlan
Date: Tue Aug 17 11:25:57 2010
New Revision: 84137
Log:
Ignore the exact ID value for the nested function in the dis.code_info tests
Modified:
python/branches/py3k/Lib/test/test_dis.py
Modified: python/branches/py3k/Lib/test/test_dis.py
==============================================================================
--- python/branches/py3k/Lib/test/test_dis.py (original)
+++ python/branches/py3k/Lib/test/test_dis.py Tue Aug 17 11:25:57 2010
@@ -259,7 +259,7 @@
Flags: OPTIMIZED, NEWLOCALS, VARARGS, VARKEYWORDS, GENERATOR
Constants:
0: None
- 1: <code object f at {1}, file "{0}", line {2}>
+ 1: <code object f at (.*), file "{0}", line {1}>
Variable names:
0: x
1: y
@@ -276,7 +276,6 @@
3: y
4: x
5: z""".format(__file__,
- hex(id(co_tricky_nested_f)),
co_tricky_nested_f.co_firstlineno)
code_info_tricky_nested_f = """\
@@ -356,14 +355,14 @@
def test_code_info(self):
self.maxDiff = 1000
for x, expected in self.test_pairs:
- self.assertEqual(dis.code_info(x), expected)
+ self.assertRegexpMatches(dis.code_info(x), expected)
def test_show_code(self):
self.maxDiff = 1000
for x, expected in self.test_pairs:
with captured_stdout() as output:
dis.show_code(x)
- self.assertEqual(output.getvalue(), expected+"\n")
+ self.assertRegexpMatches(output.getvalue(), expected+"\n")
def test_main():
run_unittest(DisTests, CodeInfoTests)
More information about the Python-checkins
mailing list