Message111548
Eli,
test_trace_module.py is a good start and I would like to commit it soon. I have a few nitpicks and a suggestion.
1. pprint module is not used in the tests so it should not be imported.
2. It is better to do run_unittest(__name__) in test_main() than list tests explicitly. run_unittest(__name__) will find all classes that derive from TestCase in the module. Note that not all test runners use test_main().
3. Please don't start docstrings with a space.
4. test_trace is out of the way in 2.7 now, so you can use proper name. If you use SVN, please do svn add Lib/test/test_trace.py with your next revision and post the output of svn diff.
5. A suggestion: since we are doing "white-box" testing of the Trace class, I would recommend calling Trace methods such as globaltrace or localtrace directly from unit tests rather than rely on settrace registrations. That may require faking frames, but I think you can get away with simply passing the current frame with the events. Whether or not sys.settrace is working correctly is tested in the old test_trace (renamed to test_sys_settrace) now.
Thanks for moving this forward. |
|
Date |
User |
Action |
Args |
2010-07-25 16:21:24 | belopolsky | set | recipients:
+ belopolsky, terry.reedy, eli.bendersky |
2010-07-25 16:21:24 | belopolsky | set | messageid: <1280074884.86.0.215095317309.issue9315@psf.upfronthosting.co.za> |
2010-07-25 16:21:23 | belopolsky | link | issue9315 messages |
2010-07-25 16:21:22 | belopolsky | create | |
|