Message221921
Although the turtledemo modules are not run directly during by "make test" or by "python -m test -uall", they are currently being inadvertently imported by test___all__. This can lead to test failures and side effects because some of the turtledemo modules execute code on import, rather than only when being run via calls to their main() functions. A quick glance shows problems with the following demos: clock (calls mode("logo") which causes a window to appear), colormixer (which unconditionally calls sys.setrecursionlimit()), and two_canvases (which is not structured using functions at all). Depending on how tests are run, these problems can cause serious side effects.
At a minimum,
1. test___all__ should be changed to exclude turtledemo modules.
It would also be nice to make the demos better citizens:
2. move the mode() call to main() in clock
3. move the setrecursionlimit call to main() and save and restore the original value on exit
4. restructure two_canvases to be like the other demos.
5. double-check all demos for other cases where interpreter state is changed and not restored. |
|
Date |
User |
Action |
Args |
2014-06-29 23:56:02 | ned.deily | set | recipients:
+ ned.deily |
2014-06-29 23:56:01 | ned.deily | set | messageid: <1404086161.6.0.896977354321.issue21882@psf.upfronthosting.co.za> |
2014-06-29 23:56:01 | ned.deily | link | issue21882 messages |
2014-06-29 23:56:01 | ned.deily | create | |
|