Berker Peksag added the comment: Antoine and Éric: Thank you for the reviews and suggestions.
> Why the "__unittest" variable? I added the "__unittest" variable after read issue 7815 and the related changeset: http://hg.python.org/cpython/rev/2858cae540e4/ See also: - http://stackoverflow.com/questions/12583015/how-can-i-hide-my-stack-frames-in-a-testcase-subclass - https://github.com/nose-devs/nose2/pull/28/files However, without the variable tracebacks are still clear: $ pyunit -v test_acc (test_bar.TestAcc) ... ok test_acc_negative (test_bar.TestAccNegative) ... ok test_mul (test_foo.TestMul) ... ok test_mul_negative (test_foo.TestMulNegative) ... ok test_mul (test_baz.TestMul) ... FAIL ====================================================================== FAIL: test_mul (test_baz.TestMul) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/berker/hacking/cpython/test_baz.py", line 12, in test_mul self.assertEqual(3, mul(2, 2)) AssertionError: 3 != 4 ---------------------------------------------------------------------- Ran 5 tests in 0.002s FAILED (failures=1) > Also, it would be better to make unittest's API more flexible, rather > than manually tweaking sys.argv to enable discovery. You're right. Something like that? unittest.main(discover=True) > About the script: can’t it be as simple as runpy.run_module? I will try that, thanks. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14266> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com