Patches item #1671298, was opened at 2007-02-28 15:38 Message generated for change (Comment added) made by jyzude You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1671298&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Tests Group: Python 2.6 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Mike Verdone (jyzude) Assigned to: Nobody/Anonymous (nobody) Summary: Refactor test_class to use unittest lib Initial Comment: Refactored Lib/test/test_class.py to use unittest library instead of icky output comparison tests. Also have to delete output/test_class after adding this patch. ---------------------------------------------------------------------- >Comment By: Mike Verdone (jyzude) Date: 2007-03-07 14:07 Message: Logged In: YES user_id=584997 Originator: YES Removed unnecessary global statement in trackCall. Anything else? :-) File Added: test_class.patch ---------------------------------------------------------------------- Comment By: Georg Brandl (gbrandl) Date: 2007-03-06 18:03 Message: Logged In: YES user_id=849994 Originator: NO Note that you don't need the global statement for callLst as you aren't rebinding it in the function. ---------------------------------------------------------------------- Comment By: Mike Verdone (jyzude) Date: 2007-03-05 23:38 Message: Logged In: YES user_id=584997 Originator: YES Hi collin, * I improved testMixIntsAndLongs. It now asserts things * assert is banished, replaced by the correct calls * the reason why callLst is global is because I have to track calls to __getitem__ in some cases. Because of this, if I put callLst on the object I end up with horrible recursive loops, or at the very least the last call on the stack will always be __getitem__ when I get the list to inspect. * assertLastCall only checks the last thing on the list because generally the thing called before that is always __getitem__ or associated magic. I don't want my tests to be bound to the internals of __getitem__. All I care about is that ultimately the right function was called. That said, I modified assertLastCallWas to erase the callLst to prevent any possible bleed-over from the previous test. Let me know if you have further suggestions. File Added: test_class.patch ---------------------------------------------------------------------- Comment By: Collin Winter (collinwinter) Date: 2007-03-05 17:11 Message: Logged In: YES user_id=1344176 Originator: NO Thanks for your effort! This generally looks good. A few minor things: - testMixIntsAndLongs doesn't have any assertions in it. - "assert" statements should probably be changed to use the failUnlessEqual/assertEqual methods. - I'm wary of your assertLastCallWas system; I'd feel more comfortable if you were making assertions about the entire call chain, not just its last item. Also, something like callLst feels strange as a global. Feel free to contact me to discuss this off-list. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1671298&group_id=5470 _______________________________________________ Patches mailing list Patches@python.org http://mail.python.org/mailman/listinfo/patches