diff --git a/AUTHORS b/AUTHORS index 3c23d2277..f3461addf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -330,6 +330,7 @@ Ronny Pfannschmidt Ross Lawley Ruaridh Williamson Russel Winder +Ryan Puddephatt Ryan Wooden Sadra Barikbin Saiprasad Kale diff --git a/changelog/11091.doc.rst b/changelog/11091.doc.rst new file mode 100644 index 000000000..429f2ac28 --- /dev/null +++ b/changelog/11091.doc.rst @@ -0,0 +1 @@ +Updated documentation and tests to refer to hyphonated options: replaced ``--junitxml`` with ``--junit-xml`` and ``--collectonly`` with ``--collect-only``. diff --git a/changelog/README.rst b/changelog/README.rst index 6d026f57e..88956ef28 100644 --- a/changelog/README.rst +++ b/changelog/README.rst @@ -14,7 +14,7 @@ Each file should be named like ``..rst``, where ```` is an issue number, and ```` is one of: * ``feature``: new user facing features, like new command-line options and new behavior. -* ``improvement``: improvement of existing functionality, usually without requiring user intervention (for example, new fields being written in ``--junitxml``, improved colors in terminal, etc). +* ``improvement``: improvement of existing functionality, usually without requiring user intervention (for example, new fields being written in ``--junit-xml``, improved colors in terminal, etc). * ``bugfix``: fixes a bug. * ``doc``: documentation improvement, like rewording an entire session or adding missing docs. * ``deprecation``: feature deprecation. diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index 7b4e99965..0e47bdb09 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -645,7 +645,7 @@ By using ``legacy`` you will keep using the legacy/xunit1 format when upgrading pytest 6.0, where the default format will be ``xunit2``. In order to let users know about the transition, pytest will issue a warning in case -the ``--junitxml`` option is given in the command line but ``junit_family`` is not explicitly +the ``--junit-xml`` option is given in the command line but ``junit_family`` is not explicitly configured in ``pytest.ini``. Services known to support the ``xunit2`` format: diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 55fd1f576..6cdf4eb42 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -136,7 +136,7 @@ Or select multiple nodes: Node IDs for failing tests are displayed in the test summary info when running pytest with the ``-rf`` option. You can also - construct Node IDs from the output of ``pytest --collectonly``. + construct Node IDs from the output of ``pytest --collect-only``. Using ``-k expr`` to select tests based on their name ------------------------------------------------------- diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index 5648aa383..b798e711a 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -1090,4 +1090,4 @@ application with standard ``pytest`` command-line options: .. code-block:: bash - ./app_main --pytest --verbose --tb=long --junitxml=results.xml test-suite/ + ./app_main --pytest --verbose --tb=long --junit=xml=results.xml test-suite/ diff --git a/doc/en/how-to/output.rst b/doc/en/how-to/output.rst index e8e9af0c7..cf72a2d29 100644 --- a/doc/en/how-to/output.rst +++ b/doc/en/how-to/output.rst @@ -478,7 +478,7 @@ integration servers, use this invocation: .. code-block:: bash - pytest --junitxml=path + pytest --junit-xml=path to create an XML file at ``path``. diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index ed259e4c4..9ee35b84e 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -369,7 +369,7 @@ def record_testsuite_property(request: FixtureRequest) -> Callable[[str, object] __tracebackhide__ = True def record_func(name: str, value: object) -> None: - """No-op function in case --junitxml was not passed in the command-line.""" + """No-op function in case --junit-xml was not passed in the command-line.""" __tracebackhide__ = True _check_record_param_type("name", name) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index ea1c30214..99d33954d 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -1063,7 +1063,7 @@ class Pytester: return self.inline_run(*values) def inline_genitems(self, *args) -> Tuple[List[Item], HookRecorder]: - """Run ``pytest.main(['--collectonly'])`` in-process. + """Run ``pytest.main(['--collect-only'])`` in-process. Runs the :py:func:`pytest.main` function to run all of pytest inside the test process itself like :py:meth:`inline_run`, but returns a diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index 4ee9e32d6..16ec37f9a 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -1518,7 +1518,7 @@ class TestMetafuncFunctional: pass """ ) - result = pytester.runpytest("--collectonly") + result = pytester.runpytest("--collect-only") result.stdout.fnmatch_lines( [ "collected 0 items / 1 error",