Skip to content

Commit b472817

Browse files
committed
Implement scope in depends() function.
1 parent 7e86d27 commit b472817

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pytest_dependency.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def checkDepend(self, depends, item):
9696
pytest.skip("%s depends on %s" % (item.name, i))
9797

9898

99-
def depends(request, other, scope="module"):
99+
def depends(request, other, scope='module'):
100100
"""Add dependency on other test.
101101
102102
Call pytest.skip() unless a successful outcome of all of the tests in
@@ -121,7 +121,7 @@ def depends(request, other, scope="module"):
121121
the scope parameter has been added.
122122
"""
123123
item = request.node
124-
manager = DependencyManager.getManager(item)
124+
manager = DependencyManager.getManager(item, scope=scope)
125125
manager.checkDepend(other, item)
126126

127127

tests/test_03_scope.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ def test_l(self):
482482
test_scope_named.py::TestClass::test_l SKIPPED
483483
""")
484484

485-
@pytest.mark.xfail(reason="scope arg to depends() not yet implemented")
486485
def test_scope_dependsfunc(ctestdir):
487486
"""Test the scope argument to the depends() function.
488487
"""

0 commit comments

Comments
 (0)