Message177748
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. |
|
Date |
User |
Action |
Args |
2012-12-19 15:49:26 | berker.peksag | set | recipients:
+ berker.peksag, pitrou, eric.araujo, michael.foord, asvetlov, hieu.nguyen |
2012-12-19 15:48:32 | berker.peksag | set | messageid: <1355932109.91.0.732415919675.issue14266@psf.upfronthosting.co.za> |
2012-12-19 15:48:00 | berker.peksag | link | issue14266 messages |
2012-12-19 15:47:17 | berker.peksag | create | |
|