Skip to content

Commit 7402518

Browse files
committed
Readme changes
1 parent 2985e65 commit 7402518

File tree

1 file changed

+21
-26
lines changed

1 file changed

+21
-26
lines changed

README.md

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ Or you can manually download the latest released version from
6060
[PyPI](https://pypi.python.org/pypi/unittest-xml-reporting/).
6161

6262

63+
## Command-line
64+
65+
````bash
66+
python -m xmlrunner [options]
67+
python -m xmlrunner discover [options]
68+
69+
# help
70+
python -m xmlrunner -h
71+
````
72+
73+
e.g.
74+
````bash
75+
python -m xmlrunner discover -t ~/mycode/tests -o /tmp/build/junit-reports
76+
````
77+
6378
## Usage
6479

6580
The script below, adapted from the
@@ -157,32 +172,12 @@ TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'
157172

158173
Also, the following settings are provided so you can fine tune the reports:
159174

160-
**TEST_OUTPUT_VERBOSE** (Default: `1`, choose between `0`,`1`, and `2`)
161-
162-
Besides the XML reports generated by the test runner, a bunch of useful
163-
information is printed to the `sys.stderr` stream, just like the
164-
`TextTestRunner` does. Use this setting to choose between a verbose and a
165-
non-verbose output.
166-
167-
**TEST_OUTPUT_DESCRIPTIONS** (Default: `False`)
168-
169-
If your test methods contains docstrings, you can display such docstrings
170-
instead of display the test name (ex: `module.TestCase.test_method`). In
171-
order to use this feature, you have to enable verbose output by setting
172-
`TEST_OUTPUT_VERBOSE = 2`.
173-
174-
**TEST_OUTPUT_DIR** (Default: `"."`)
175-
176-
Tells the test runner where to put the XML reports. If the directory
177-
couldn't be found, the test runner will try to create it before
178-
generate the XML files.
179-
180-
**TEST_OUTPUT_FILE_NAME** (Default: `None`)
181-
182-
Tells the test runner to output a single XML report with this filename
183-
under `os.path.join(TEST_OUTPUT_DIR, TEST_OUTPUT_FILE_NAME)`. Please note
184-
that for long running tests, this will keep the results in memory for
185-
a longer time than multiple reports, and may use up more resources.
175+
|setting|default|values|description|
176+
|-|-|-|-|
177+
|`TEST_OUTPUT_VERBOSE`|`1`|`0|1|2`|Besides the XML reports generated by the test runner, a bunch of useful information is printed to the `sys.stderr` stream, just like the `TextTestRunner` does. Use this setting to choose between a verbose and a non-verbose output.|
178+
|`TEST_OUTPUT_DESCRIPTIONS`|`False`|`True|False`|If your test methods contains docstrings, you can display such docstrings instead of display the test name (ex: `module.TestCase.test_method`).<br>In order to use this feature, you have to enable verbose output by setting `TEST_OUTPUT_VERBOSE = 2`.<br>Only effects stdout and not XML output.|
179+
|`TEST_OUTPUT_DIR`|`"."`|`<str>`|Tells the test runner where to put the XML reports. If the directory couldn't be found, the test runner will try to create it before generate the XML files.|
180+
|`TEST_OUTPUT_FILE_NAME`|`None`|`<str>`|Tells the test runner to output a single XML report with this filename under `os.path.join(TEST_OUTPUT_DIR, TEST_OUTPUT_FILE_NAME)`.<br>Please note that for long running tests, this will keep the results in memory for a longer time than multiple reports, and may use up more resources.|
186181

187182

188183
## Contributing

0 commit comments

Comments
 (0)