Skip to content

Commit 1c0bc52

Browse files
committed
Merge branch 'register-marker'
2 parents ee9dad8 + a4bbab7 commit 1c0bc52

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

CHANGES

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
History of changes to pytest-dependency
22
=======================================
33

4+
* Version 0.4 (not yet released)
5+
6+
** Bug fixes and minor changes
7+
8+
+ Issue #5: properly register the dependency marker.
9+
10+
+ Do not add the documentation to the source distribution.
11+
412
* Version 0.3.1 (2017-12-26)
513

614
** Bug fixes and minor changes

pytest_dependency.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ def pytest_configure(config):
117117
global _automark, _ignore_unknown
118118
_automark = _get_bool(config.getini("automark_dependency"))
119119
_ignore_unknown = config.getoption("--ignore-unknown-dependency")
120+
config.addinivalue_line("markers",
121+
"dependency(name=None, depends=[]): "
122+
"mark a test to be used as a dependency for "
123+
"other tests or to depend on other tests.")
120124

121125

122126
@pytest.hookimpl(tryfirst=True, hookwrapper=True)

tests/test_01_marker.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
import pytest
55

66

7+
def test_marker_registered(ctestdir):
8+
result = ctestdir.runpytest("--markers")
9+
result.stdout.fnmatch_lines("""
10+
@pytest.mark.dependency*
11+
""")
12+
13+
714
def test_marker(ctestdir):
815
ctestdir.makepyfile("""
916
import pytest

0 commit comments

Comments
 (0)