[Python-Dev] Test breakage due to optparse

Tim Peters tim.peters at gmail.com
Sat Jul 31 22:24:52 CEST 2004

Heads up.  Recent changes to optparse and/or to its test are causing
several spurious test failures,  Here's a minimal incantation to get
the first new failure of this kind:

C:\Code\python\PCbuild>python  -E -tt ../lib/test/regrtest.py
test_optparse test_pep277
test test_pep277 produced unexpected output:
*** lines 2-4 of actual output doesn't appear in expected output after line 1:
+ u'\xdf-\u66e8\u66e9\u66eb'
+ ['???', '???', '??????', '????????????', '????G\xdf', 'Ge??-sa?',
'Gr\xfc\xdf-Gott', 'abc', 'ascii']
+ [u'Gr\xfc\xdf-Gott', u'abc', u'ascii',
u'\u05d4\u05e9\u05e7\u05e6\u05e5\u05e1', u'\u306b\u307d\u3093',
05e9\u3093\u0434\u0393\xdf', u'\u66e8\u66e9\u66eb']
1 test OK.
1 test failed:

In all, with a complete test run, there are 15 spurious test failures
on Windows now:

15 tests failed:
    test_pep277 test_pkg test_popen test_popen2 test_profile
    test_pyexpat test_regex test_rgbimg test_rotor test_scope
    test_thread test_threadedtempfile test_tokenize test_winreg

No idea why.  Offhand, from the symptoms it looks like a change may be
sending stdout into a black hole.  Constructs like

          sys.stdout = StringIO()
!         self.assertRaises(self.parser.parse_args, (cmdline_args,), None,
!                           SystemExit, expected_output,
!                           self.redirected_stdout)
          sys.stdout = sys.__stdout__

in the patch certainly intensify that suspicion <wink>.

More information about the Python-Dev mailing list