This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky, eli.bendersky, terry.reedy
Date 2010-07-25.16:21:22
SpamBayes Score 0.00047527874
Marked as misclassified No
Message-id <1280074884.86.0.215095317309.issue9315@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-07-25 16:21:24belopolskysetrecipients: + belopolsky, terry.reedy, eli.bendersky
2010-07-25 16:21:24belopolskysetmessageid: <1280074884.86.0.215095317309.issue9315@psf.upfronthosting.co.za>
2010-07-25 16:21:23belopolskylinkissue9315 messages
2010-07-25 16:21:22belopolskycreate