@@ -259,7 +259,7 @@ def f(c=c):
259259Flags: OPTIMIZED, NEWLOCALS, VARARGS, VARKEYWORDS, GENERATOR
260260Constants:
261261 0: None
262- 1: <code object f at {1} , file "{0}", line {2 }>
262+ 1: <code object f at (.*) , file "{0}", line {1 }>
263263Variable names:
264264 0: x
265265 1: y
@@ -276,7 +276,6 @@ def f(c=c):
276276 3: y
277277 4: x
278278 5: z""" .format (__file__ ,
279- hex (id (co_tricky_nested_f )),
280279 co_tricky_nested_f .co_firstlineno )
281280
282281code_info_tricky_nested_f = """\
@@ -356,14 +355,14 @@ class CodeInfoTests(unittest.TestCase):
356355 def test_code_info (self ):
357356 self .maxDiff = 1000
358357 for x , expected in self .test_pairs :
359- self .assertEqual (dis .code_info (x ), expected )
358+ self .assertRegexpMatches (dis .code_info (x ), expected )
360359
361360 def test_show_code (self ):
362361 self .maxDiff = 1000
363362 for x , expected in self .test_pairs :
364363 with captured_stdout () as output :
365364 dis .show_code (x )
366- self .assertEqual (output .getvalue (), expected + "\n " )
365+ self .assertRegexpMatches (output .getvalue (), expected + "\n " )
367366
368367def test_main ():
369368 run_unittest (DisTests , CodeInfoTests )
0 commit comments