Skip to content

Commit 3ab70cd

Browse files
authored
Use hyphenated cmdline options in docs (#11490)
Fix #11091
1 parent 23825f2 commit 3ab70cd

File tree

10 files changed

+10
-8
lines changed

10 files changed

+10
-8
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ Ronny Pfannschmidt
330330
Ross Lawley
331331
Ruaridh Williamson
332332
Russel Winder
333+
Ryan Puddephatt
333334
Ryan Wooden
334335
Sadra Barikbin
335336
Saiprasad Kale

changelog/11091.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updated documentation and tests to refer to hyphonated options: replaced ``--junitxml`` with ``--junit-xml`` and ``--collectonly`` with ``--collect-only``.

changelog/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Each file should be named like ``<ISSUE>.<TYPE>.rst``, where
1414
``<ISSUE>`` is an issue number, and ``<TYPE>`` is one of:
1515

1616
* ``feature``: new user facing features, like new command-line options and new behavior.
17-
* ``improvement``: improvement of existing functionality, usually without requiring user intervention (for example, new fields being written in ``--junitxml``, improved colors in terminal, etc).
17+
* ``improvement``: improvement of existing functionality, usually without requiring user intervention (for example, new fields being written in ``--junit-xml``, improved colors in terminal, etc).
1818
* ``bugfix``: fixes a bug.
1919
* ``doc``: documentation improvement, like rewording an entire session or adding missing docs.
2020
* ``deprecation``: feature deprecation.

doc/en/deprecations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ By using ``legacy`` you will keep using the legacy/xunit1 format when upgrading
645645
pytest 6.0, where the default format will be ``xunit2``.
646646

647647
In order to let users know about the transition, pytest will issue a warning in case
648-
the ``--junitxml`` option is given in the command line but ``junit_family`` is not explicitly
648+
the ``--junit-xml`` option is given in the command line but ``junit_family`` is not explicitly
649649
configured in ``pytest.ini``.
650650

651651
Services known to support the ``xunit2`` format:

doc/en/example/markers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Or select multiple nodes:
136136

137137
Node IDs for failing tests are displayed in the test summary info
138138
when running pytest with the ``-rf`` option. You can also
139-
construct Node IDs from the output of ``pytest --collectonly``.
139+
construct Node IDs from the output of ``pytest --collect-only``.
140140

141141
Using ``-k expr`` to select tests based on their name
142142
-------------------------------------------------------

doc/en/example/simple.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,4 +1090,4 @@ application with standard ``pytest`` command-line options:
10901090

10911091
.. code-block:: bash
10921092
1093-
./app_main --pytest --verbose --tb=long --junitxml=results.xml test-suite/
1093+
./app_main --pytest --verbose --tb=long --junit=xml=results.xml test-suite/

doc/en/how-to/output.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ integration servers, use this invocation:
478478

479479
.. code-block:: bash
480480
481-
pytest --junitxml=path
481+
pytest --junit-xml=path
482482
483483
to create an XML file at ``path``.
484484

src/_pytest/junitxml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def test_foo(record_testsuite_property):
369369
__tracebackhide__ = True
370370

371371
def record_func(name: str, value: object) -> None:
372-
"""No-op function in case --junitxml was not passed in the command-line."""
372+
"""No-op function in case --junit-xml was not passed in the command-line."""
373373
__tracebackhide__ = True
374374
_check_record_param_type("name", name)
375375

src/_pytest/pytester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ def inline_runsource(self, source: str, *cmdlineargs) -> HookRecorder:
10631063
return self.inline_run(*values)
10641064

10651065
def inline_genitems(self, *args) -> Tuple[List[Item], HookRecorder]:
1066-
"""Run ``pytest.main(['--collectonly'])`` in-process.
1066+
"""Run ``pytest.main(['--collect-only'])`` in-process.
10671067
10681068
Runs the :py:func:`pytest.main` function to run all of pytest inside
10691069
the test process itself like :py:meth:`inline_run`, but returns a

testing/python/metafunc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ def test_foo(x):
15181518
pass
15191519
"""
15201520
)
1521-
result = pytester.runpytest("--collectonly")
1521+
result = pytester.runpytest("--collect-only")
15221522
result.stdout.fnmatch_lines(
15231523
[
15241524
"collected 0 items / 1 error",

0 commit comments

Comments
 (0)