Message 226600 - Python tracker (original) (raw)

Thanks for landing this barry, there's a couple quirks with your improvements - loadTestsFromModule(mod, foo, bar) will raise a TypeError but not warn about foo the way loadTestsFromModule(mod, foo) will.

Secondly, the TypeError has an off-by-one error in its output:

loadTestsFromModule(mod, foo, bar) will claim 2 arguments were passed. Three were.

diff -r d0ff527c53da Lib/unittest/loader.py --- a/Lib/unittest/loader.py Mon Sep 08 14:21:37 2014 -0400 +++ b/Lib/unittest/loader.py Tue Sep 09 07:32:05 2014 +1200 @@ -79,12 +79,12 @@ # use_load_tests argument. For backward compatibility, we still # accept the argument (which can also be the first position) but we # ignore it and issue a deprecation warning if it's present.

diff -r d0ff527c53da Lib/unittest/test/test_loader.py --- a/Lib/unittest/test/test_loader.py Mon Sep 08 14:21:37 2014 -0400 +++ b/Lib/unittest/test/test_loader.py Tue Sep 09 07:32:05 2014 +1200 @@ -272,7 +272,7 @@ # however use_load_tests (which sorts first) is ignored. self.assertEqual( str(cm.exception),