Ray*_*emi 3 python python-unittest
我正在使用发现模式运行 Python 单元测试:
% python -m unittest discover
Run Code Online (Sandbox Code Playgroud)
系统为每个测试打印一个点,但我宁愿看到测试名称。
有没有一个选项可以实现这种情况?
详细标志 ( -v) 就是您要寻找的:
$ python -m unittest discover -v
test_a (tests.test_a.TestA) ... ok
test_b (tests.test_b.TestB) ... ok
...
Run Code Online (Sandbox Code Playgroud)
如需更多选项,请检查:
$ python -m unittest --help
usage: python -m unittest [-h] [-v] [-q] [--locals] [-f] [-c] [-b]
[tests [tests ...]]
positional arguments:
tests a list of any number of test modules, classes and test
methods.
optional arguments:
-h, --help show this help message and exit
-v, --verbose Verbose output
-q, --quiet Quiet output
--locals Show local variables in tracebacks
-f, --failfast Stop on first fail or error
-c, --catch Catch Ctrl-C and display results so far
-b, --buffer Buffer stdout and stderr during tests
...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1310 次 |
| 最近记录: |