Skip to content

Commit 619309c

Browse files
authored
Merge pull request #10 from jbasko/dev
Register random_order marker so it’s displayed on pytest --markers
2 parents 964b413 + 3262366 commit 619309c

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

pytest_random_order/plugin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ def pytest_addoption(parser):
1616
)
1717

1818

19+
def pytest_configure(config):
20+
config.addinivalue_line("markers", "random_order(disabled=True): disable reordering of tests within a module or class")
21+
22+
1923
def pytest_report_header(config):
2024
out = None
2125

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def read(fname):
1313

1414
setup(
1515
name='pytest-random-order',
16-
version='0.5.0',
16+
version='0.5.1',
1717
author='Jazeps Basko',
1818
author_email='[email protected]',
1919
maintainer='Jazeps Basko',

tests/test_cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@ def test_help_message(testdir):
66
'random-order:',
77
'*--random-order-bucket={global,package,module,class}*',
88
])
9+
10+
11+
def test_markers_message(testdir):
12+
result = testdir.runpytest(
13+
'--markers',
14+
)
15+
result.stdout.fnmatch_lines([
16+
'*@pytest.mark.random_order(disabled=True): disable reordering*',
17+
])

0 commit comments

Comments
 (0)