◐ Shell
clean mode source ↗

Message 189712 - Python tracker

Problem solved at least for me with a new patch:

D:\Python\dev\py33\PCbuild> python_d -m test test_idle
[1/1] test_idle
Warning -- os.environ was modified by test_idle
1 test altered the execution environment:
    test_idle

...> python_d -m test
... 
[154/373/2] test_httpservers
[155/373/2] test_idle
[156/373/2] test_imaplib
...

The new patch has two simple changes to test_idle.

1. The traceback David and I saw started in regrtest.runtest_inner:
    the_package = __import__(abstest, globals(), locals(), [])
The rest of the calls were in unittest. This line runs fine in isolation, but it does not matter; regrtest does not want the test to run when it imports the file. Add 'if name ...' to guard main(...).

2. With no test_main present, the key line of runtest_inner is
    tests = unittest.TestLoader().loadTestsFromModule(the_module)
Unittest.main makes the same call to look for, among other things, a load_tests function. Import load_tests from idlelib.idle_test.