Skip to content

Commit de2afd0

Browse files
authored
Update: Group CLI options (#67)
1 parent b02463a commit de2afd0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Release Notes
44
3.0.0 (unreleased)
55
------------------
66

7+
* Group CLI options
8+
9+
* Thanks to `@xmuskrat <https://github.com/xmuskrat>`_ for reporting.
10+
711
* Switch to Hatch
812

913
* Use `pytest.stash` internally instead of `_metadata`

src/pytest_metadata/plugin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def include_metadata_in_junit_xml(metadata, pytestconfig, record_testsuite_prope
5555

5656

5757
def pytest_addoption(parser):
58-
parser.addoption(
58+
group = parser.getgroup("pytest-metadata")
59+
group.addoption(
5960
"--metadata",
6061
action="append",
6162
default=[],
@@ -64,14 +65,14 @@ def pytest_addoption(parser):
6465
nargs=2,
6566
help="additional metadata.",
6667
)
67-
parser.addoption(
68+
group.addoption(
6869
"--metadata-from-json",
6970
action="store",
7071
default="{}",
7172
dest="metadata_from_json",
7273
help="additional metadata from a json string.",
7374
)
74-
parser.addoption(
75+
group.addoption(
7576
"--metadata-from-json-file",
7677
type=str,
7778
dest="metadata_from_json_file",

0 commit comments

Comments
 (0)