I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-dependency-0.5.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-dependency-0.5.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1
plugins: dependency-0.5.1
collected 27 items
tests/test_01_marker.py .. [ 7%]
tests/test_02_simple_dependency.py FFFFFF [ 29%]
tests/test_03_class.py FFF [ 40%]
tests/test_03_multiple_dependency.py F [ 44%]
tests/test_03_param.py F [ 48%]
tests/test_03_runtime.py F [ 51%]
tests/test_03_scope.py FFFFFFF [ 77%]
tests/test_03_skipmsgs.py F [ 81%]
tests/test_04_automark.py FF. [ 92%]
tests/test_04_ignore_unknown.py F. [100%]
================================================================================= FAILURES =================================================================================
_______________________________________________________________________________ test_no_skip _______________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_no_skip0')>
def test_no_skip(ctestdir):
"""One test is skipped, but no other test depends on it,
so all other tests pass.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency()
def test_a():
pytest.skip("explicit skip")
@pytest.mark.dependency()
def test_b():
pass
@pytest.mark.dependency(depends=["test_b"])
def test_c():
pass
@pytest.mark.dependency(depends=["test_c"])
def test_d():
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=3, skipped=1, failed=0)
> result.stdout.fnmatch_lines("""
*::test_a SKIPPED
*::test_b PASSED
*::test_c PASSED
*::test_d PASSED
""")
E Failed: nomatch: '*::test_a SKIPPED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_no_skip0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 4 items'
E and: ''
E and: 'test_no_skip.py::test_a SKIPPED (explicit skip)'
E and: 'test_no_skip.py::test_b PASSED'
E and: 'test_no_skip.py::test_c PASSED'
E and: 'test_no_skip.py::test_d PASSED'
E and: ''
E and: '========================= 3 passed, 1 skipped in 0.01s ========================='
E remains unmatched: '*::test_a SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_02_simple_dependency.py:32: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_no_skip0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 4 items
test_no_skip.py::test_a SKIPPED (explicit skip)
test_no_skip.py::test_b PASSED
test_no_skip.py::test_c PASSED
test_no_skip.py::test_d PASSED
========================= 3 passed, 1 skipped in 0.01s =========================
_____________________________________________________________________________ test_skip_depend _____________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_skip_depend0')>
def test_skip_depend(ctestdir):
"""One test is skipped, other dependent tests are skipped as well.
This also includes indirect dependencies.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency()
def test_a():
pass
@pytest.mark.dependency()
def test_b():
pytest.skip("explicit skip")
@pytest.mark.dependency(depends=["test_b"])
def test_c():
pass
@pytest.mark.dependency(depends=["test_c"])
def test_d():
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=1, skipped=3, failed=0)
> result.stdout.fnmatch_lines("""
*::test_a PASSED
*::test_b SKIPPED
*::test_c SKIPPED
*::test_d SKIPPED
""")
E Failed: nomatch: '*::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_skip_depend0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 4 items'
E and: ''
E fnmatch: '*::test_a PASSED'
E with: 'test_skip_depend.py::test_a PASSED'
E nomatch: '*::test_b SKIPPED'
E and: 'test_skip_depend.py::test_b SKIPPED (explicit skip)'
E and: 'test_skip_depend.py::test_c SKIPPED (test_c depends on test_b)'
E and: 'test_skip_depend.py::test_d SKIPPED (test_d depends on test_c)'
E and: ''
E and: '========================= 1 passed, 3 skipped in 0.01s ========================='
E remains unmatched: '*::test_b SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_02_simple_dependency.py:65: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_skip_depend0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 4 items
test_skip_depend.py::test_a PASSED
test_skip_depend.py::test_b SKIPPED (explicit skip)
test_skip_depend.py::test_c SKIPPED (test_c depends on test_b)
test_skip_depend.py::test_d SKIPPED (test_d depends on test_c)
========================= 1 passed, 3 skipped in 0.01s =========================
_____________________________________________________________________________ test_fail_depend _____________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_fail_depend0')>
def test_fail_depend(ctestdir):
"""One test fails, other dependent tests are skipped.
This also includes indirect dependencies.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency()
def test_a():
pass
@pytest.mark.dependency()
def test_b():
assert False
@pytest.mark.dependency(depends=["test_b"])
def test_c():
pass
@pytest.mark.dependency(depends=["test_c"])
def test_d():
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=1, skipped=2, failed=1)
> result.stdout.fnmatch_lines("""
*::test_a PASSED
*::test_b FAILED
*::test_c SKIPPED
*::test_d SKIPPED
""")
E Failed: nomatch: '*::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_fail_depend0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 4 items'
E and: ''
E fnmatch: '*::test_a PASSED'
E with: 'test_fail_depend.py::test_a PASSED'
E fnmatch: '*::test_b FAILED'
E with: 'test_fail_depend.py::test_b FAILED'
E nomatch: '*::test_c SKIPPED'
E and: 'test_fail_depend.py::test_c SKIPPED (test_c depends on test_b)'
E and: 'test_fail_depend.py::test_d SKIPPED (test_d depends on test_c)'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '____________________________________ test_b ____________________________________'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_b():'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_fail_depend.py:9: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'FAILED test_fail_depend.py::test_b - assert False'
E and: '==================== 1 failed, 1 passed, 2 skipped in 0.01s ===================='
E remains unmatched: '*::test_c SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_02_simple_dependency.py:98: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_fail_depend0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 4 items
test_fail_depend.py::test_a PASSED
test_fail_depend.py::test_b FAILED
test_fail_depend.py::test_c SKIPPED (test_c depends on test_b)
test_fail_depend.py::test_d SKIPPED (test_d depends on test_c)
=================================== FAILURES ===================================
____________________________________ test_b ____________________________________
@pytest.mark.dependency()
def test_b():
> assert False
E assert False
test_fail_depend.py:9: AssertionError
=========================== short test summary info ============================
FAILED test_fail_depend.py::test_b - assert False
==================== 1 failed, 1 passed, 2 skipped in 0.01s ====================
__________________________________________________________________________ test_named_fail_depend __________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_named_fail_depend0')>
def test_named_fail_depend(ctestdir):
"""Same as test_fail_depend, but using custom test names.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency(name="a")
def test_a():
pass
@pytest.mark.dependency(name="b")
def test_b():
assert False
@pytest.mark.dependency(name="c", depends=["b"])
def test_c():
pass
@pytest.mark.dependency(name="d", depends=["c"])
def test_d():
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=1, skipped=2, failed=1)
> result.stdout.fnmatch_lines("""
*::test_a PASSED
*::test_b FAILED
*::test_c SKIPPED
*::test_d SKIPPED
""")
E Failed: nomatch: '*::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_named_fail_depend0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 4 items'
E and: ''
E fnmatch: '*::test_a PASSED'
E with: 'test_named_fail_depend.py::test_a PASSED'
E fnmatch: '*::test_b FAILED'
E with: 'test_named_fail_depend.py::test_b FAILED'
E nomatch: '*::test_c SKIPPED'
E and: 'test_named_fail_depend.py::test_c SKIPPED (test_c depends on b)'
E and: 'test_named_fail_depend.py::test_d SKIPPED (test_d depends on c)'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '____________________________________ test_b ____________________________________'
E and: ''
E and: ' @pytest.mark.dependency(name="b")'
E and: ' def test_b():'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_named_fail_depend.py:9: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'FAILED test_named_fail_depend.py::test_b - assert False'
E and: '==================== 1 failed, 1 passed, 2 skipped in 0.01s ===================='
E remains unmatched: '*::test_c SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_02_simple_dependency.py:130: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_named_fail_depend0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 4 items
test_named_fail_depend.py::test_a PASSED
test_named_fail_depend.py::test_b FAILED
test_named_fail_depend.py::test_c SKIPPED (test_c depends on b)
test_named_fail_depend.py::test_d SKIPPED (test_d depends on c)
=================================== FAILURES ===================================
____________________________________ test_b ____________________________________
@pytest.mark.dependency(name="b")
def test_b():
> assert False
E assert False
test_named_fail_depend.py:9: AssertionError
=========================== short test summary info ============================
FAILED test_named_fail_depend.py::test_b - assert False
==================== 1 failed, 1 passed, 2 skipped in 0.01s ====================
___________________________________________________________________________ test_explicit_select ___________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_explicit_select0')>
def test_explicit_select(ctestdir):
"""Explicitly select only a single test that depends on another one.
Since the other test has not been run at all, the selected test
will be skipped.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency()
def test_a():
pass
@pytest.mark.dependency()
def test_b():
pass
@pytest.mark.dependency()
def test_c():
pass
@pytest.mark.dependency(depends=["test_c"])
def test_d():
pass
""")
result = ctestdir.runpytest("--verbose", "test_explicit_select.py::test_d")
result.assert_outcomes(passed=0, skipped=1, failed=0)
> result.stdout.fnmatch_lines("""
*::test_d SKIPPED
""")
E Failed: nomatch: '*::test_d SKIPPED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_explicit_select0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 1 item'
E and: ''
E and: 'test_explicit_select.py::test_d SKIPPED (test_d depends on test_c)'
E and: ''
E and: '============================== 1 skipped in 0.01s =============================='
E remains unmatched: '*::test_d SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_02_simple_dependency.py:165: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_explicit_select0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 1 item
test_explicit_select.py::test_d SKIPPED (test_d depends on test_c)
============================== 1 skipped in 0.01s ==============================
___________________________________________________________________________ test_depend_unknown ____________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_depend_unknown0')>
def test_depend_unknown(ctestdir):
"""Depend on an unknown test that is not even defined in the test set.
Note that is not an error to depend on an undefined test, but the
dependent test will be skipped since the non-existent dependency
has not been run successfully.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency()
def test_a():
pass
@pytest.mark.dependency()
def test_b():
pass
@pytest.mark.dependency()
def test_c():
pass
@pytest.mark.dependency(depends=["test_x"])
def test_d():
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=3, skipped=1, failed=0)
> result.stdout.fnmatch_lines("""
*::test_a PASSED
*::test_b PASSED
*::test_c PASSED
*::test_d SKIPPED
""")
E Failed: nomatch: '*::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_depend_unknown0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 4 items'
E and: ''
E fnmatch: '*::test_a PASSED'
E with: 'test_depend_unknown.py::test_a PASSED'
E fnmatch: '*::test_b PASSED'
E with: 'test_depend_unknown.py::test_b PASSED'
E fnmatch: '*::test_c PASSED'
E with: 'test_depend_unknown.py::test_c PASSED'
E nomatch: '*::test_d SKIPPED'
E and: 'test_depend_unknown.py::test_d SKIPPED (test_d depends on test_x)'
E and: ''
E and: '========================= 3 passed, 1 skipped in 0.01s ========================='
E remains unmatched: '*::test_d SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_02_simple_dependency.py:198: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_depend_unknown0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 4 items
test_depend_unknown.py::test_a PASSED
test_depend_unknown.py::test_b PASSED
test_depend_unknown.py::test_c PASSED
test_depend_unknown.py::test_d SKIPPED (test_d depends on test_x)
========================= 3 passed, 1 skipped in 0.01s =========================
____________________________________________________________________________ test_class_simple _____________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_class_simple0')>
def test_class_simple(ctestdir):
"""Simple dependencies of test methods in a class.
test_a() deliberately fails, some other methods depend on it, some don't.
"""
ctestdir.makepyfile("""
import pytest
class TestClass(object):
@pytest.mark.dependency()
def test_a(self):
assert False
@pytest.mark.dependency()
def test_b(self):
pass
@pytest.mark.dependency(depends=["TestClass::test_a"])
def test_c(self):
pass
@pytest.mark.dependency(depends=["TestClass::test_b"])
def test_d(self):
pass
@pytest.mark.dependency(depends=["TestClass::test_b",
"TestClass::test_c"])
def test_e(self):
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=2, skipped=2, failed=1)
> result.stdout.fnmatch_lines("""
*::TestClass::test_a FAILED
*::TestClass::test_b PASSED
*::TestClass::test_c SKIPPED
*::TestClass::test_d PASSED
*::TestClass::test_e SKIPPED
""")
E Failed: nomatch: '*::TestClass::test_a FAILED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_class_simple0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 5 items'
E and: ''
E fnmatch: '*::TestClass::test_a FAILED'
E with: 'test_class_simple.py::TestClass::test_a FAILED'
E fnmatch: '*::TestClass::test_b PASSED'
E with: 'test_class_simple.py::TestClass::test_b PASSED'
E nomatch: '*::TestClass::test_c SKIPPED'
E and: 'test_class_simple.py::TestClass::test_c SKIPPED (test_c depends on T...)'
E and: 'test_class_simple.py::TestClass::test_d PASSED'
E and: 'test_class_simple.py::TestClass::test_e SKIPPED (test_e depends on T...)'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '_______________________________ TestClass.test_a _______________________________'
E and: ''
E and: 'self = <test_class_simple.TestClass object at 0x7f015c465460>'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_a(self):'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_class_simple.py:7: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'FAILED test_class_simple.py::TestClass::test_a - assert False'
E and: '==================== 1 failed, 2 passed, 2 skipped in 0.02s ===================='
E remains unmatched: '*::TestClass::test_c SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_class.py:39: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_class_simple0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 5 items
test_class_simple.py::TestClass::test_a FAILED
test_class_simple.py::TestClass::test_b PASSED
test_class_simple.py::TestClass::test_c SKIPPED (test_c depends on T...)
test_class_simple.py::TestClass::test_d PASSED
test_class_simple.py::TestClass::test_e SKIPPED (test_e depends on T...)
=================================== FAILURES ===================================
_______________________________ TestClass.test_a _______________________________
self = <test_class_simple.TestClass object at 0x7f015c465460>
@pytest.mark.dependency()
def test_a(self):
> assert False
E assert False
test_class_simple.py:7: AssertionError
=========================== short test summary info ============================
FAILED test_class_simple.py::TestClass::test_a - assert False
==================== 1 failed, 2 passed, 2 skipped in 0.02s ====================
_________________________________________________________________________ test_class_simple_named __________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_class_simple_named0')>
def test_class_simple_named(ctestdir):
"""Mostly the same as test_class_simple(), but name the test methods
now explicitely.
"""
ctestdir.makepyfile("""
import pytest
class TestClassNamed(object):
@pytest.mark.dependency(name="a")
def test_a(self):
assert False
@pytest.mark.dependency(name="b")
def test_b(self):
pass
@pytest.mark.dependency(name="c", depends=["a"])
def test_c(self):
pass
@pytest.mark.dependency(name="d", depends=["b"])
def test_d(self):
pass
@pytest.mark.dependency(name="e", depends=["b", "c"])
def test_e(self):
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=2, skipped=2, failed=1)
> result.stdout.fnmatch_lines("""
*::TestClassNamed::test_a FAILED
*::TestClassNamed::test_b PASSED
*::TestClassNamed::test_c SKIPPED
*::TestClassNamed::test_d PASSED
*::TestClassNamed::test_e SKIPPED
""")
E Failed: nomatch: '*::TestClassNamed::test_a FAILED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_class_simple_named0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 5 items'
E and: ''
E fnmatch: '*::TestClassNamed::test_a FAILED'
E with: 'test_class_simple_named.py::TestClassNamed::test_a FAILED'
E fnmatch: '*::TestClassNamed::test_b PASSED'
E with: 'test_class_simple_named.py::TestClassNamed::test_b PASSED'
E nomatch: '*::TestClassNamed::test_c SKIPPED'
E and: 'test_class_simple_named.py::TestClassNamed::test_c SKIPPED (test_c d...)'
E and: 'test_class_simple_named.py::TestClassNamed::test_d PASSED'
E and: 'test_class_simple_named.py::TestClassNamed::test_e SKIPPED (test_e d...)'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '____________________________ TestClassNamed.test_a _____________________________'
E and: ''
E and: 'self = <test_class_simple_named.TestClassNamed object at 0x7f015c3d85e0>'
E and: ''
E and: ' @pytest.mark.dependency(name="a")'
E and: ' def test_a(self):'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_class_simple_named.py:7: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'FAILED test_class_simple_named.py::TestClassNamed::test_a - assert False'
E and: '==================== 1 failed, 2 passed, 2 skipped in 0.02s ===================='
E remains unmatched: '*::TestClassNamed::test_c SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_class.py:79: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_class_simple_named0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 5 items
test_class_simple_named.py::TestClassNamed::test_a FAILED
test_class_simple_named.py::TestClassNamed::test_b PASSED
test_class_simple_named.py::TestClassNamed::test_c SKIPPED (test_c d...)
test_class_simple_named.py::TestClassNamed::test_d PASSED
test_class_simple_named.py::TestClassNamed::test_e SKIPPED (test_e d...)
=================================== FAILURES ===================================
____________________________ TestClassNamed.test_a _____________________________
self = <test_class_simple_named.TestClassNamed object at 0x7f015c3d85e0>
@pytest.mark.dependency(name="a")
def test_a(self):
> assert False
E assert False
test_class_simple_named.py:7: AssertionError
=========================== short test summary info ============================
FAILED test_class_simple_named.py::TestClassNamed::test_a - assert False
==================== 1 failed, 2 passed, 2 skipped in 0.02s ====================
_________________________________________________________________________ test_class_default_name __________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_class_default_name0')>
def test_class_default_name(ctestdir):
"""Issue #6: for methods of test classes, the default name used to be
the method name. This could have caused conflicts if there is a
function having the same name outside the class. In the following
example, before fixing this issue, the method test_a() of class
TestClass would have shadowed the failure of function test_a().
Now the class name is prepended to the default test name, removing
this conflict.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency()
def test_a():
assert False
class TestClass(object):
@pytest.mark.dependency()
def test_a(self):
pass
@pytest.mark.dependency(depends=["test_a"])
def test_b():
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=1, skipped=1, failed=1)
> result.stdout.fnmatch_lines("""
*::test_a FAILED
*::TestClass::test_a PASSED
*::test_b SKIPPED
""")
E Failed: nomatch: '*::test_a FAILED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_class_default_name0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 3 items'
E and: ''
E fnmatch: '*::test_a FAILED'
E with: 'test_class_default_name.py::test_a FAILED'
E fnmatch: '*::TestClass::test_a PASSED'
E with: 'test_class_default_name.py::TestClass::test_a PASSED'
E nomatch: '*::test_b SKIPPED'
E and: 'test_class_default_name.py::test_b SKIPPED (test_b depends on test_a)'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '____________________________________ test_a ____________________________________'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_a():'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_class_default_name.py:5: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'FAILED test_class_default_name.py::test_a - assert False'
E and: '==================== 1 failed, 1 passed, 1 skipped in 0.01s ===================='
E remains unmatched: '*::test_b SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_class.py:117: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_class_default_name0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 3 items
test_class_default_name.py::test_a FAILED
test_class_default_name.py::TestClass::test_a PASSED
test_class_default_name.py::test_b SKIPPED (test_b depends on test_a)
=================================== FAILURES ===================================
____________________________________ test_a ____________________________________
@pytest.mark.dependency()
def test_a():
> assert False
E assert False
test_class_default_name.py:5: AssertionError
=========================== short test summary info ============================
FAILED test_class_default_name.py::test_a - assert False
==================== 1 failed, 1 passed, 1 skipped in 0.01s ====================
______________________________________________________________________________ test_multiple _______________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_multiple0')>
def test_multiple(ctestdir):
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency(name="a")
def test_a():
pytest.skip("explicit skip")
@pytest.mark.dependency(name="b")
def test_b():
assert False
@pytest.mark.dependency(name="c")
def test_c():
pass
@pytest.mark.dependency(name="d")
def test_d():
pass
@pytest.mark.dependency(name="e")
def test_e():
pass
@pytest.mark.dependency(name="f", depends=["a", "c"])
def test_f():
pass
@pytest.mark.dependency(name="g", depends=["b", "d"])
def test_g():
pass
@pytest.mark.dependency(name="h", depends=["c", "e"])
def test_h():
pass
@pytest.mark.dependency(name="i", depends=["f", "h"])
def test_i():
pass
@pytest.mark.dependency(name="j", depends=["d", "h"])
def test_j():
pass
@pytest.mark.dependency(name="k", depends=["g", "i", "j"])
def test_k():
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=5, skipped=5, failed=1)
> result.stdout.fnmatch_lines("""
*::test_a SKIPPED
*::test_b FAILED
*::test_c PASSED
*::test_d PASSED
*::test_e PASSED
*::test_f SKIPPED
*::test_g SKIPPED
*::test_h PASSED
*::test_i SKIPPED
*::test_j PASSED
*::test_k SKIPPED
""")
E Failed: nomatch: '*::test_a SKIPPED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_multiple0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 11 items'
E and: ''
E and: 'test_multiple.py::test_a SKIPPED (explicit skip)'
E and: 'test_multiple.py::test_b FAILED'
E and: 'test_multiple.py::test_c PASSED'
E and: 'test_multiple.py::test_d PASSED'
E and: 'test_multiple.py::test_e PASSED'
E and: 'test_multiple.py::test_f SKIPPED (test_f depends on a)'
E and: 'test_multiple.py::test_g SKIPPED (test_g depends on b)'
E and: 'test_multiple.py::test_h PASSED'
E and: 'test_multiple.py::test_i SKIPPED (test_i depends on f)'
E and: 'test_multiple.py::test_j PASSED'
E and: 'test_multiple.py::test_k SKIPPED (test_k depends on g)'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '____________________________________ test_b ____________________________________'
E and: ''
E and: ' @pytest.mark.dependency(name="b")'
E and: ' def test_b():'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_multiple.py:9: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'FAILED test_multiple.py::test_b - assert False'
E and: '==================== 1 failed, 5 passed, 5 skipped in 0.03s ===================='
E remains unmatched: '*::test_a SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_multiple_dependency.py:57: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_multiple0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 11 items
test_multiple.py::test_a SKIPPED (explicit skip)
test_multiple.py::test_b FAILED
test_multiple.py::test_c PASSED
test_multiple.py::test_d PASSED
test_multiple.py::test_e PASSED
test_multiple.py::test_f SKIPPED (test_f depends on a)
test_multiple.py::test_g SKIPPED (test_g depends on b)
test_multiple.py::test_h PASSED
test_multiple.py::test_i SKIPPED (test_i depends on f)
test_multiple.py::test_j PASSED
test_multiple.py::test_k SKIPPED (test_k depends on g)
=================================== FAILURES ===================================
____________________________________ test_b ____________________________________
@pytest.mark.dependency(name="b")
def test_b():
> assert False
E assert False
test_multiple.py:9: AssertionError
=========================== short test summary info ============================
FAILED test_multiple.py::test_b - assert False
==================== 1 failed, 5 passed, 5 skipped in 0.03s ====================
______________________________________________________________________________ test_multiple _______________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_multiple1')>
def test_multiple(ctestdir):
ctestdir.makepyfile("""
import pytest
_md = pytest.mark.dependency
@pytest.mark.parametrize("x,y", [
pytest.param(0, 0, marks=_md(name="a1")),
pytest.param(0, 1, marks=_md(name="a2")),
pytest.param(1, 0, marks=_md(name="a3")),
pytest.param(1, 1, marks=_md(name="a4"))
])
def test_a(x,y):
assert x==0 or y==0
@pytest.mark.parametrize("u,v", [
pytest.param(1, 2, marks=_md(name="b1", depends=["a1", "a2"])),
pytest.param(1, 3, marks=_md(name="b2", depends=["a1", "a3"])),
pytest.param(1, 4, marks=_md(name="b3", depends=["a1", "a4"])),
pytest.param(2, 3, marks=_md(name="b4", depends=["a2", "a3"])),
pytest.param(2, 4, marks=_md(name="b5", depends=["a2", "a4"])),
pytest.param(3, 4, marks=_md(name="b6", depends=["a3", "a4"]))
])
def test_b(u,v):
pass
@pytest.mark.parametrize("w", [
pytest.param(1, marks=_md(name="c1", depends=["b1", "b3", "b5"])),
pytest.param(2, marks=_md(name="c2", depends=["b1", "b3", "b6"])),
pytest.param(3, marks=_md(name="c3", depends=["b1", "b2", "b4"]))
])
def test_c(w):
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=7, skipped=5, failed=1)
> result.stdout.fnmatch_lines("""
*::test_a?0-0? PASSED
*::test_a?0-1? PASSED
*::test_a?1-0? PASSED
*::test_a?1-1? FAILED
*::test_b?1-2? PASSED
*::test_b?1-3? PASSED
*::test_b?1-4? SKIPPED
*::test_b?2-3? PASSED
*::test_b?2-4? SKIPPED
*::test_b?3-4? SKIPPED
*::test_c?1? SKIPPED
*::test_c?2? SKIPPED
*::test_c?3? PASSED
""")
E Failed: nomatch: '*::test_a?0-0? PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_multiple1, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 13 items'
E and: ''
E fnmatch: '*::test_a?0-0? PASSED'
E with: 'test_multiple.py::test_a[0-0] PASSED'
E fnmatch: '*::test_a?0-1? PASSED'
E with: 'test_multiple.py::test_a[0-1] PASSED'
E fnmatch: '*::test_a?1-0? PASSED'
E with: 'test_multiple.py::test_a[1-0] PASSED'
E fnmatch: '*::test_a?1-1? FAILED'
E with: 'test_multiple.py::test_a[1-1] FAILED'
E fnmatch: '*::test_b?1-2? PASSED'
E with: 'test_multiple.py::test_b[1-2] PASSED'
E fnmatch: '*::test_b?1-3? PASSED'
E with: 'test_multiple.py::test_b[1-3] PASSED'
E nomatch: '*::test_b?1-4? SKIPPED'
E and: 'test_multiple.py::test_b[1-4] SKIPPED (test_b[1-4] depends on a4)'
E and: 'test_multiple.py::test_b[2-3] PASSED'
E and: 'test_multiple.py::test_b[2-4] SKIPPED (test_b[2-4] depends on a4)'
E and: 'test_multiple.py::test_b[3-4] SKIPPED (test_b[3-4] depends on a4)'
E and: 'test_multiple.py::test_c[1] SKIPPED (test_c[1] depends on b3)'
E and: 'test_multiple.py::test_c[2] SKIPPED (test_c[2] depends on b3)'
E and: 'test_multiple.py::test_c[3] PASSED'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '_________________________________ test_a[1-1] __________________________________'
E and: ''
E and: 'x = 1, y = 1'
E and: ''
E and: ' @pytest.mark.parametrize("x,y", ['
E and: ' pytest.param(0, 0, marks=_md(name="a1")),'
E and: ' pytest.param(0, 1, marks=_md(name="a2")),'
E and: ' pytest.param(1, 0, marks=_md(name="a3")),'
E and: ' pytest.param(1, 1, marks=_md(name="a4"))'
E and: ' ])'
E and: ' def test_a(x,y):'
E and: '> assert x==0 or y==0'
E and: 'E assert (1 == 0'
E and: 'E +1'
E and: 'E -0 or 1 == 0'
E and: 'E +1'
E and: 'E -0)'
E and: ''
E and: 'test_multiple.py:12: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'FAILED test_multiple.py::test_a[1-1] - assert (1 == 0'
E and: '==================== 1 failed, 7 passed, 5 skipped in 0.03s ===================='
E remains unmatched: '*::test_b?1-4? SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_param.py:43: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_multiple1, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 13 items
test_multiple.py::test_a[0-0] PASSED
test_multiple.py::test_a[0-1] PASSED
test_multiple.py::test_a[1-0] PASSED
test_multiple.py::test_a[1-1] FAILED
test_multiple.py::test_b[1-2] PASSED
test_multiple.py::test_b[1-3] PASSED
test_multiple.py::test_b[1-4] SKIPPED (test_b[1-4] depends on a4)
test_multiple.py::test_b[2-3] PASSED
test_multiple.py::test_b[2-4] SKIPPED (test_b[2-4] depends on a4)
test_multiple.py::test_b[3-4] SKIPPED (test_b[3-4] depends on a4)
test_multiple.py::test_c[1] SKIPPED (test_c[1] depends on b3)
test_multiple.py::test_c[2] SKIPPED (test_c[2] depends on b3)
test_multiple.py::test_c[3] PASSED
=================================== FAILURES ===================================
_________________________________ test_a[1-1] __________________________________
x = 1, y = 1
@pytest.mark.parametrize("x,y", [
pytest.param(0, 0, marks=_md(name="a1")),
pytest.param(0, 1, marks=_md(name="a2")),
pytest.param(1, 0, marks=_md(name="a3")),
pytest.param(1, 1, marks=_md(name="a4"))
])
def test_a(x,y):
> assert x==0 or y==0
E assert (1 == 0
E +1
E -0 or 1 == 0
E +1
E -0)
test_multiple.py:12: AssertionError
=========================== short test summary info ============================
FAILED test_multiple.py::test_a[1-1] - assert (1 == 0
==================== 1 failed, 7 passed, 5 skipped in 0.03s ====================
_________________________________________________________________________ test_skip_depend_runtime _________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_skip_depend_runtime0')>
def test_skip_depend_runtime(ctestdir):
"""One test is skipped, other dependent tests are skipped as well.
This also includes indirect dependencies.
"""
ctestdir.makepyfile("""
import pytest
from pytest_dependency import depends
@pytest.mark.dependency()
def test_a():
pass
@pytest.mark.dependency()
def test_b():
pytest.skip("explicit skip")
@pytest.mark.dependency()
def test_c(request):
depends(request, ["test_b"])
pass
@pytest.mark.dependency()
def test_d(request):
depends(request, ["test_a", "test_c"])
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=1, skipped=3, failed=0)
> result.stdout.fnmatch_lines("""
*::test_a PASSED
*::test_b SKIPPED
*::test_c SKIPPED
*::test_d SKIPPED
""")
E Failed: nomatch: '*::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_skip_depend_runtime0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 4 items'
E and: ''
E fnmatch: '*::test_a PASSED'
E with: 'test_skip_depend_runtime.py::test_a PASSED'
E nomatch: '*::test_b SKIPPED'
E and: 'test_skip_depend_runtime.py::test_b SKIPPED (explicit skip)'
E and: 'test_skip_depend_runtime.py::test_c SKIPPED (test_c depends on test_b)'
E and: 'test_skip_depend_runtime.py::test_d SKIPPED (test_d depends on test_c)'
E and: ''
E and: '========================= 1 passed, 3 skipped in 0.01s ========================='
E remains unmatched: '*::test_b SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_runtime.py:35: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_skip_depend_runtime0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 4 items
test_skip_depend_runtime.py::test_a PASSED
test_skip_depend_runtime.py::test_b SKIPPED (explicit skip)
test_skip_depend_runtime.py::test_c SKIPPED (test_c depends on test_b)
test_skip_depend_runtime.py::test_d SKIPPED (test_d depends on test_c)
========================= 1 passed, 3 skipped in 0.01s =========================
____________________________________________________________________________ test_scope_module _____________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_scope_module0')>
def test_scope_module(ctestdir):
"""One single module, module scope is explicitely set in the
pytest.mark.dependency() marker.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency()
def test_a():
assert False
@pytest.mark.dependency()
def test_b():
pass
@pytest.mark.dependency(depends=["test_a"], scope='module')
def test_c():
pass
@pytest.mark.dependency(depends=["test_b"], scope='module')
def test_d():
pass
@pytest.mark.dependency(depends=["test_b", "test_c"], scope='module')
def test_e():
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=2, skipped=2, failed=1)
> result.stdout.fnmatch_lines("""
test_scope_module.py::test_a FAILED
test_scope_module.py::test_b PASSED
test_scope_module.py::test_c SKIPPED
test_scope_module.py::test_d PASSED
test_scope_module.py::test_e SKIPPED
""")
E Failed: nomatch: 'test_scope_module.py::test_a FAILED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_module0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 5 items'
E and: ''
E exact match: 'test_scope_module.py::test_a FAILED'
E exact match: 'test_scope_module.py::test_b PASSED'
E nomatch: 'test_scope_module.py::test_c SKIPPED'
E and: 'test_scope_module.py::test_c SKIPPED (test_c depends on test_a)'
E and: 'test_scope_module.py::test_d PASSED'
E and: 'test_scope_module.py::test_e SKIPPED (test_e depends on test_c)'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '____________________________________ test_a ____________________________________'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_a():'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_scope_module.py:5: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'FAILED test_scope_module.py::test_a - assert False'
E and: '==================== 1 failed, 2 passed, 2 skipped in 0.02s ===================='
E remains unmatched: 'test_scope_module.py::test_c SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_scope.py:36: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_module0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 5 items
test_scope_module.py::test_a FAILED
test_scope_module.py::test_b PASSED
test_scope_module.py::test_c SKIPPED (test_c depends on test_a)
test_scope_module.py::test_d PASSED
test_scope_module.py::test_e SKIPPED (test_e depends on test_c)
=================================== FAILURES ===================================
____________________________________ test_a ____________________________________
@pytest.mark.dependency()
def test_a():
> assert False
E assert False
test_scope_module.py:5: AssertionError
=========================== short test summary info ============================
FAILED test_scope_module.py::test_a - assert False
==================== 1 failed, 2 passed, 2 skipped in 0.02s ====================
____________________________________________________________________________ test_scope_session ____________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_scope_session0')>
def test_scope_session(ctestdir):
"""Two modules, some cross module dependencies in session scope.
"""
ctestdir.makepyfile(test_scope_session_01="""
import pytest
@pytest.mark.dependency()
def test_a():
pass
@pytest.mark.dependency()
def test_b():
assert False
@pytest.mark.dependency(depends=["test_a"])
def test_c():
pass
class TestClass(object):
@pytest.mark.dependency()
def test_b(self):
pass
""", test_scope_session_02="""
import pytest
@pytest.mark.dependency()
def test_a():
assert False
@pytest.mark.dependency(
depends=["test_scope_session_01.py::test_a",
"test_scope_session_01.py::test_c"],
scope='session'
)
def test_e():
pass
@pytest.mark.dependency(
depends=["test_scope_session_01.py::test_b"],
scope='session'
)
def test_f():
pass
@pytest.mark.dependency(
depends=["test_scope_session_02.py::test_e"],
scope='session'
)
def test_g():
pass
@pytest.mark.dependency(
depends=["test_scope_session_01.py::TestClass::test_b"],
scope='session'
)
def test_h():
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=6, skipped=1, failed=2)
> result.stdout.fnmatch_lines("""
test_scope_session_01.py::test_a PASSED
test_scope_session_01.py::test_b FAILED
test_scope_session_01.py::test_c PASSED
test_scope_session_01.py::TestClass::test_b PASSED
test_scope_session_02.py::test_a FAILED
test_scope_session_02.py::test_e PASSED
test_scope_session_02.py::test_f SKIPPED
test_scope_session_02.py::test_g PASSED
test_scope_session_02.py::test_h PASSED
""")
E Failed: nomatch: 'test_scope_session_01.py::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_session0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 9 items'
E and: ''
E exact match: 'test_scope_session_01.py::test_a PASSED'
E exact match: 'test_scope_session_01.py::test_b FAILED'
E exact match: 'test_scope_session_01.py::test_c PASSED'
E exact match: 'test_scope_session_01.py::TestClass::test_b PASSED'
E exact match: 'test_scope_session_02.py::test_a FAILED'
E exact match: 'test_scope_session_02.py::test_e PASSED'
E nomatch: 'test_scope_session_02.py::test_f SKIPPED'
E and: 'test_scope_session_02.py::test_f SKIPPED (test_f depends on test_sco...)'
E and: 'test_scope_session_02.py::test_g PASSED'
E and: 'test_scope_session_02.py::test_h PASSED'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '____________________________________ test_b ____________________________________'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_b():'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_scope_session_01.py:9: AssertionError'
E and: '____________________________________ test_a ____________________________________'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_a():'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_scope_session_02.py:5: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'FAILED test_scope_session_01.py::test_b - assert False'
E and: 'FAILED test_scope_session_02.py::test_a - assert False'
E and: '==================== 2 failed, 6 passed, 1 skipped in 0.03s ===================='
E remains unmatched: 'test_scope_session_02.py::test_f SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_scope.py:105: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_session0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 9 items
test_scope_session_01.py::test_a PASSED
test_scope_session_01.py::test_b FAILED
test_scope_session_01.py::test_c PASSED
test_scope_session_01.py::TestClass::test_b PASSED
test_scope_session_02.py::test_a FAILED
test_scope_session_02.py::test_e PASSED
test_scope_session_02.py::test_f SKIPPED (test_f depends on test_sco...)
test_scope_session_02.py::test_g PASSED
test_scope_session_02.py::test_h PASSED
=================================== FAILURES ===================================
____________________________________ test_b ____________________________________
@pytest.mark.dependency()
def test_b():
> assert False
E assert False
test_scope_session_01.py:9: AssertionError
____________________________________ test_a ____________________________________
@pytest.mark.dependency()
def test_a():
> assert False
E assert False
test_scope_session_02.py:5: AssertionError
=========================== short test summary info ============================
FAILED test_scope_session_01.py::test_b - assert False
FAILED test_scope_session_02.py::test_a - assert False
==================== 2 failed, 6 passed, 1 skipped in 0.03s ====================
____________________________________________________________________________ test_scope_package ____________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_scope_package0')>
def test_scope_package(ctestdir):
"""Two packages, some cross module dependencies within the package and
across package boundaries.
"""
ctestdir.mkpydir("test_scope_package_a")
ctestdir.mkpydir("test_scope_package_b")
srcs = {
'test_scope_package_a/test_01': """
import pytest
@pytest.mark.dependency()
def test_a():
pass
""",
'test_scope_package_b/test_02': """
import pytest
@pytest.mark.dependency()
def test_c():
pass
@pytest.mark.dependency()
def test_d():
assert False
""",
'test_scope_package_b/test_03': """
import pytest
@pytest.mark.dependency(
depends=["test_scope_package_a/test_01.py::test_a"],
scope='session'
)
def test_e():
pass
@pytest.mark.dependency(
depends=["test_scope_package_a/test_01.py::test_a"],
scope='package'
)
def test_f():
pass
@pytest.mark.dependency(
depends=["test_scope_package_b/test_02.py::test_c"],
scope='package'
)
def test_g():
pass
@pytest.mark.dependency(
depends=["test_scope_package_b/test_02.py::test_d"],
scope='package'
)
def test_h():
pass
""",
}
ctestdir.makepyfile(**srcs)
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=4, skipped=2, failed=1)
> result.stdout.fnmatch_lines("""
test_scope_package_a/test_01.py::test_a PASSED
test_scope_package_b/test_02.py::test_c PASSED
test_scope_package_b/test_02.py::test_d FAILED
test_scope_package_b/test_03.py::test_e PASSED
test_scope_package_b/test_03.py::test_f SKIPPED
test_scope_package_b/test_03.py::test_g PASSED
test_scope_package_b/test_03.py::test_h SKIPPED
""")
E Failed: nomatch: 'test_scope_package_a/test_01.py::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_package0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 7 items'
E and: ''
E exact match: 'test_scope_package_a/test_01.py::test_a PASSED'
E exact match: 'test_scope_package_b/test_02.py::test_c PASSED'
E exact match: 'test_scope_package_b/test_02.py::test_d FAILED'
E exact match: 'test_scope_package_b/test_03.py::test_e PASSED'
E nomatch: 'test_scope_package_b/test_03.py::test_f SKIPPED'
E and: 'test_scope_package_b/test_03.py::test_f SKIPPED (test_f depends on t...)'
E and: 'test_scope_package_b/test_03.py::test_g PASSED'
E and: 'test_scope_package_b/test_03.py::test_h SKIPPED (test_h depends on t...)'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '____________________________________ test_d ____________________________________'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_d():'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_scope_package_b/test_02.py:9: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'FAILED test_scope_package_b/test_02.py::test_d - assert False'
E and: '==================== 1 failed, 4 passed, 2 skipped in 0.03s ===================='
E remains unmatched: 'test_scope_package_b/test_03.py::test_f SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_scope.py:177: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_package0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 7 items
test_scope_package_a/test_01.py::test_a PASSED
test_scope_package_b/test_02.py::test_c PASSED
test_scope_package_b/test_02.py::test_d FAILED
test_scope_package_b/test_03.py::test_e PASSED
test_scope_package_b/test_03.py::test_f SKIPPED (test_f depends on t...)
test_scope_package_b/test_03.py::test_g PASSED
test_scope_package_b/test_03.py::test_h SKIPPED (test_h depends on t...)
=================================== FAILURES ===================================
____________________________________ test_d ____________________________________
@pytest.mark.dependency()
def test_d():
> assert False
E assert False
test_scope_package_b/test_02.py:9: AssertionError
=========================== short test summary info ============================
FAILED test_scope_package_b/test_02.py::test_d - assert False
==================== 1 failed, 4 passed, 2 skipped in 0.03s ====================
_____________________________________________________________________________ test_scope_class _____________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_scope_class0')>
def test_scope_class(ctestdir):
"""Dependencies in class scope.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency()
def test_a():
assert False
@pytest.mark.dependency()
def test_b():
pass
class TestClass1(object):
@pytest.mark.dependency()
def test_c(self):
pass
class TestClass2(object):
@pytest.mark.dependency()
def test_a(self):
pass
@pytest.mark.dependency()
def test_b(self):
assert False
@pytest.mark.dependency(depends=["test_a"])
def test_d(self):
pass
@pytest.mark.dependency(depends=["test_b"])
def test_e(self):
pass
@pytest.mark.dependency(depends=["test_a"], scope='class')
def test_f(self):
pass
@pytest.mark.dependency(depends=["test_b"], scope='class')
def test_g(self):
pass
@pytest.mark.dependency(depends=["test_c"], scope='class')
def test_h(self):
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=5, skipped=3, failed=2)
> result.stdout.fnmatch_lines("""
test_scope_class.py::test_a FAILED
test_scope_class.py::test_b PASSED
test_scope_class.py::TestClass1::test_c PASSED
test_scope_class.py::TestClass2::test_a PASSED
test_scope_class.py::TestClass2::test_b FAILED
test_scope_class.py::TestClass2::test_d SKIPPED
test_scope_class.py::TestClass2::test_e PASSED
test_scope_class.py::TestClass2::test_f PASSED
test_scope_class.py::TestClass2::test_g SKIPPED
test_scope_class.py::TestClass2::test_h SKIPPED
""")
E Failed: nomatch: 'test_scope_class.py::test_a FAILED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_class0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 10 items'
E and: ''
E exact match: 'test_scope_class.py::test_a FAILED'
E exact match: 'test_scope_class.py::test_b PASSED'
E exact match: 'test_scope_class.py::TestClass1::test_c PASSED'
E exact match: 'test_scope_class.py::TestClass2::test_a PASSED'
E exact match: 'test_scope_class.py::TestClass2::test_b FAILED'
E nomatch: 'test_scope_class.py::TestClass2::test_d SKIPPED'
E and: 'test_scope_class.py::TestClass2::test_d SKIPPED (test_d depends on t...)'
E and: 'test_scope_class.py::TestClass2::test_e PASSED'
E and: 'test_scope_class.py::TestClass2::test_f PASSED'
E and: 'test_scope_class.py::TestClass2::test_g SKIPPED (test_g depends on t...)'
E and: 'test_scope_class.py::TestClass2::test_h SKIPPED (test_h depends on t...)'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '____________________________________ test_a ____________________________________'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_a():'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_scope_class.py:5: AssertionError'
E and: '______________________________ TestClass2.test_b _______________________________'
E and: ''
E and: 'self = <test_scope_class.TestClass2 object at 0x7f015bff0190>'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_b(self):'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_scope_class.py:25: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'FAILED test_scope_class.py::test_a - assert False'
E and: 'FAILED test_scope_class.py::TestClass2::test_b - assert False'
E and: '==================== 2 failed, 5 passed, 3 skipped in 0.03s ===================='
E remains unmatched: 'test_scope_class.py::TestClass2::test_d SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_scope.py:239: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_class0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 10 items
test_scope_class.py::test_a FAILED
test_scope_class.py::test_b PASSED
test_scope_class.py::TestClass1::test_c PASSED
test_scope_class.py::TestClass2::test_a PASSED
test_scope_class.py::TestClass2::test_b FAILED
test_scope_class.py::TestClass2::test_d SKIPPED (test_d depends on t...)
test_scope_class.py::TestClass2::test_e PASSED
test_scope_class.py::TestClass2::test_f PASSED
test_scope_class.py::TestClass2::test_g SKIPPED (test_g depends on t...)
test_scope_class.py::TestClass2::test_h SKIPPED (test_h depends on t...)
=================================== FAILURES ===================================
____________________________________ test_a ____________________________________
@pytest.mark.dependency()
def test_a():
> assert False
E assert False
test_scope_class.py:5: AssertionError
______________________________ TestClass2.test_b _______________________________
self = <test_scope_class.TestClass2 object at 0x7f015bff0190>
@pytest.mark.dependency()
def test_b(self):
> assert False
E assert False
test_scope_class.py:25: AssertionError
=========================== short test summary info ============================
FAILED test_scope_class.py::test_a - assert False
FAILED test_scope_class.py::TestClass2::test_b - assert False
==================== 2 failed, 5 passed, 3 skipped in 0.03s ====================
____________________________________________________________________________ test_scope_nodeid _____________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_scope_nodeid0')>
def test_scope_nodeid(ctestdir):
"""The default name of a test is the node id.
The references to the default names must be adapted according to
the scope.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency()
def test_a():
pass
@pytest.mark.dependency(
depends=["test_a"],
scope='module'
)
def test_b():
pass
@pytest.mark.dependency(
depends=["test_scope_nodeid.py::test_a"],
scope='module'
)
def test_c():
pass
@pytest.mark.dependency(
depends=["test_a"],
scope='session'
)
def test_d():
pass
@pytest.mark.dependency(
depends=["test_scope_nodeid.py::test_a"],
scope='session'
)
def test_e():
pass
class TestClass(object):
@pytest.mark.dependency()
def test_f(self):
pass
@pytest.mark.dependency(
depends=["test_f"],
scope='class'
)
def test_g(self):
pass
@pytest.mark.dependency(
depends=["TestClass::test_f"],
scope='class'
)
def test_h(self):
pass
@pytest.mark.dependency(
depends=["test_scope_nodeid.py::TestClass::test_f"],
scope='class'
)
def test_i(self):
pass
@pytest.mark.dependency(
depends=["test_f"],
scope='module'
)
def test_j(self):
pass
@pytest.mark.dependency(
depends=["TestClass::test_f"],
scope='module'
)
def test_k(self):
pass
@pytest.mark.dependency(
depends=["test_scope_nodeid.py::TestClass::test_f"],
scope='module'
)
def test_l(self):
pass
@pytest.mark.dependency(
depends=["test_f"],
scope='session'
)
def test_m(self):
pass
@pytest.mark.dependency(
depends=["TestClass::test_f"],
scope='session'
)
def test_n(self):
pass
@pytest.mark.dependency(
depends=["test_scope_nodeid.py::TestClass::test_f"],
scope='session'
)
def test_o(self):
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=7, skipped=8, failed=0)
> result.stdout.fnmatch_lines("""
test_scope_nodeid.py::test_a PASSED
test_scope_nodeid.py::test_b PASSED
test_scope_nodeid.py::test_c SKIPPED
test_scope_nodeid.py::test_d SKIPPED
test_scope_nodeid.py::test_e PASSED
test_scope_nodeid.py::TestClass::test_f PASSED
test_scope_nodeid.py::TestClass::test_g PASSED
test_scope_nodeid.py::TestClass::test_h SKIPPED
test_scope_nodeid.py::TestClass::test_i SKIPPED
test_scope_nodeid.py::TestClass::test_j SKIPPED
test_scope_nodeid.py::TestClass::test_k PASSED
test_scope_nodeid.py::TestClass::test_l SKIPPED
test_scope_nodeid.py::TestClass::test_m SKIPPED
test_scope_nodeid.py::TestClass::test_n SKIPPED
test_scope_nodeid.py::TestClass::test_o PASSED
""")
E Failed: nomatch: 'test_scope_nodeid.py::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_nodeid0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 15 items'
E and: ''
E exact match: 'test_scope_nodeid.py::test_a PASSED'
E exact match: 'test_scope_nodeid.py::test_b PASSED'
E nomatch: 'test_scope_nodeid.py::test_c SKIPPED'
E and: 'test_scope_nodeid.py::test_c SKIPPED (test_c depends on test_scope_n...)'
E and: 'test_scope_nodeid.py::test_d SKIPPED (test_d depends on test_a)'
E and: 'test_scope_nodeid.py::test_e PASSED'
E and: 'test_scope_nodeid.py::TestClass::test_f PASSED'
E and: 'test_scope_nodeid.py::TestClass::test_g PASSED'
E and: 'test_scope_nodeid.py::TestClass::test_h SKIPPED (test_h depends on T...)'
E and: 'test_scope_nodeid.py::TestClass::test_i SKIPPED (test_i depends on t...)'
E and: 'test_scope_nodeid.py::TestClass::test_j SKIPPED (test_j depends on t...)'
E and: 'test_scope_nodeid.py::TestClass::test_k PASSED'
E and: 'test_scope_nodeid.py::TestClass::test_l SKIPPED (test_l depends on t...)'
E and: 'test_scope_nodeid.py::TestClass::test_m SKIPPED (test_m depends on t...)'
E and: 'test_scope_nodeid.py::TestClass::test_n SKIPPED (test_n depends on T...)'
E and: 'test_scope_nodeid.py::TestClass::test_o PASSED'
E and: ''
E and: '========================= 7 passed, 8 skipped in 0.03s ========================='
E remains unmatched: 'test_scope_nodeid.py::test_c SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_scope.py:363: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_nodeid0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 15 items
test_scope_nodeid.py::test_a PASSED
test_scope_nodeid.py::test_b PASSED
test_scope_nodeid.py::test_c SKIPPED (test_c depends on test_scope_n...)
test_scope_nodeid.py::test_d SKIPPED (test_d depends on test_a)
test_scope_nodeid.py::test_e PASSED
test_scope_nodeid.py::TestClass::test_f PASSED
test_scope_nodeid.py::TestClass::test_g PASSED
test_scope_nodeid.py::TestClass::test_h SKIPPED (test_h depends on T...)
test_scope_nodeid.py::TestClass::test_i SKIPPED (test_i depends on t...)
test_scope_nodeid.py::TestClass::test_j SKIPPED (test_j depends on t...)
test_scope_nodeid.py::TestClass::test_k PASSED
test_scope_nodeid.py::TestClass::test_l SKIPPED (test_l depends on t...)
test_scope_nodeid.py::TestClass::test_m SKIPPED (test_m depends on t...)
test_scope_nodeid.py::TestClass::test_n SKIPPED (test_n depends on T...)
test_scope_nodeid.py::TestClass::test_o PASSED
========================= 7 passed, 8 skipped in 0.03s =========================
_____________________________________________________________________________ test_scope_named _____________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_scope_named0')>
def test_scope_named(ctestdir):
"""Explicitely named tests are always referenced by that name,
regardless of the scope.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency(name="a")
def test_a():
pass
@pytest.mark.dependency(
depends=["a"],
scope='module'
)
def test_b():
pass
@pytest.mark.dependency(
depends=["test_a"],
scope='module'
)
def test_c():
pass
@pytest.mark.dependency(
depends=["a"],
scope='session'
)
def test_d():
pass
@pytest.mark.dependency(
depends=["test_scope_named.py::test_a"],
scope='session'
)
def test_e():
pass
class TestClass(object):
@pytest.mark.dependency(name="f")
def test_f(self):
pass
@pytest.mark.dependency(
depends=["f"],
scope='class'
)
def test_g(self):
pass
@pytest.mark.dependency(
depends=["test_f"],
scope='class'
)
def test_h(self):
pass
@pytest.mark.dependency(
depends=["f"],
scope='module'
)
def test_i(self):
pass
@pytest.mark.dependency(
depends=["TestClass::test_f"],
scope='module'
)
def test_j(self):
pass
@pytest.mark.dependency(
depends=["f"],
scope='session'
)
def test_k(self):
pass
@pytest.mark.dependency(
depends=["test_scope_named.py::TestClass::test_f"],
scope='session'
)
def test_l(self):
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=7, skipped=5, failed=0)
> result.stdout.fnmatch_lines("""
test_scope_named.py::test_a PASSED
test_scope_named.py::test_b PASSED
test_scope_named.py::test_c SKIPPED
test_scope_named.py::test_d PASSED
test_scope_named.py::test_e SKIPPED
test_scope_named.py::TestClass::test_f PASSED
test_scope_named.py::TestClass::test_g PASSED
test_scope_named.py::TestClass::test_h SKIPPED
test_scope_named.py::TestClass::test_i PASSED
test_scope_named.py::TestClass::test_j SKIPPED
test_scope_named.py::TestClass::test_k PASSED
test_scope_named.py::TestClass::test_l SKIPPED
""")
E Failed: nomatch: 'test_scope_named.py::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_named0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 12 items'
E and: ''
E exact match: 'test_scope_named.py::test_a PASSED'
E exact match: 'test_scope_named.py::test_b PASSED'
E nomatch: 'test_scope_named.py::test_c SKIPPED'
E and: 'test_scope_named.py::test_c SKIPPED (test_c depends on test_a)'
E and: 'test_scope_named.py::test_d PASSED'
E and: 'test_scope_named.py::test_e SKIPPED (test_e depends on test_scope_na...)'
E and: 'test_scope_named.py::TestClass::test_f PASSED'
E and: 'test_scope_named.py::TestClass::test_g PASSED'
E and: 'test_scope_named.py::TestClass::test_h SKIPPED (test_h depends on te...)'
E and: 'test_scope_named.py::TestClass::test_i PASSED'
E and: 'test_scope_named.py::TestClass::test_j SKIPPED (test_j depends on Te...)'
E and: 'test_scope_named.py::TestClass::test_k PASSED'
E and: 'test_scope_named.py::TestClass::test_l SKIPPED (test_l depends on te...)'
E and: ''
E and: '========================= 7 passed, 5 skipped in 0.03s ========================='
E remains unmatched: 'test_scope_named.py::test_c SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_scope.py:470: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_named0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 12 items
test_scope_named.py::test_a PASSED
test_scope_named.py::test_b PASSED
test_scope_named.py::test_c SKIPPED (test_c depends on test_a)
test_scope_named.py::test_d PASSED
test_scope_named.py::test_e SKIPPED (test_e depends on test_scope_na...)
test_scope_named.py::TestClass::test_f PASSED
test_scope_named.py::TestClass::test_g PASSED
test_scope_named.py::TestClass::test_h SKIPPED (test_h depends on te...)
test_scope_named.py::TestClass::test_i PASSED
test_scope_named.py::TestClass::test_j SKIPPED (test_j depends on Te...)
test_scope_named.py::TestClass::test_k PASSED
test_scope_named.py::TestClass::test_l SKIPPED (test_l depends on te...)
========================= 7 passed, 5 skipped in 0.03s =========================
__________________________________________________________________________ test_scope_dependsfunc __________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_scope_dependsfunc0')>
def test_scope_dependsfunc(ctestdir):
"""Test the scope argument to the depends() function.
"""
ctestdir.makepyfile(test_scope_dependsfunc_01="""
import pytest
@pytest.mark.dependency()
def test_a():
pass
@pytest.mark.dependency()
def test_b():
assert False
@pytest.mark.dependency(depends=["test_a"])
def test_c():
pass
class TestClass(object):
@pytest.mark.dependency()
def test_b(self):
pass
""", test_scope_dependsfunc_02="""
import pytest
from pytest_dependency import depends
@pytest.mark.dependency()
def test_a():
assert False
@pytest.mark.dependency()
def test_b():
pass
@pytest.mark.dependency()
def test_e(request):
depends(request,
["test_scope_dependsfunc_01.py::test_a",
"test_scope_dependsfunc_01.py::test_c"],
scope='session')
pass
@pytest.mark.dependency()
def test_f(request):
depends(request,
["test_scope_dependsfunc_01.py::test_b"],
scope='session')
pass
@pytest.mark.dependency()
def test_g(request):
depends(request,
["test_scope_dependsfunc_02.py::test_e"],
scope='session')
pass
@pytest.mark.dependency()
def test_h(request):
depends(request,
["test_scope_dependsfunc_01.py::TestClass::test_b"],
scope='session')
pass
@pytest.mark.dependency()
def test_i(request):
depends(request, ["test_a"], scope='module')
pass
@pytest.mark.dependency()
def test_j(request):
depends(request, ["test_b"], scope='module')
pass
class TestClass(object):
@pytest.mark.dependency()
def test_a(self):
pass
@pytest.mark.dependency()
def test_b(self):
assert False
@pytest.mark.dependency()
def test_c(self, request):
depends(request, ["test_a"], scope='class')
pass
@pytest.mark.dependency()
def test_d(self, request):
depends(request, ["test_b"], scope='class')
pass
""")
result = ctestdir.runpytest("--verbose")
result.assert_outcomes(passed=10, skipped=3, failed=3)
> result.stdout.fnmatch_lines("""
test_scope_dependsfunc_01.py::test_a PASSED
test_scope_dependsfunc_01.py::test_b FAILED
test_scope_dependsfunc_01.py::test_c PASSED
test_scope_dependsfunc_01.py::TestClass::test_b PASSED
test_scope_dependsfunc_02.py::test_a FAILED
test_scope_dependsfunc_02.py::test_b PASSED
test_scope_dependsfunc_02.py::test_e PASSED
test_scope_dependsfunc_02.py::test_f SKIPPED
test_scope_dependsfunc_02.py::test_g PASSED
test_scope_dependsfunc_02.py::test_h PASSED
test_scope_dependsfunc_02.py::test_i SKIPPED
test_scope_dependsfunc_02.py::test_j PASSED
test_scope_dependsfunc_02.py::TestClass::test_a PASSED
test_scope_dependsfunc_02.py::TestClass::test_b FAILED
test_scope_dependsfunc_02.py::TestClass::test_c PASSED
test_scope_dependsfunc_02.py::TestClass::test_d SKIPPED
""")
E Failed: nomatch: 'test_scope_dependsfunc_01.py::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_dependsfunc0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 16 items'
E and: ''
E exact match: 'test_scope_dependsfunc_01.py::test_a PASSED'
E exact match: 'test_scope_dependsfunc_01.py::test_b FAILED'
E exact match: 'test_scope_dependsfunc_01.py::test_c PASSED'
E exact match: 'test_scope_dependsfunc_01.py::TestClass::test_b PASSED'
E exact match: 'test_scope_dependsfunc_02.py::test_a FAILED'
E exact match: 'test_scope_dependsfunc_02.py::test_b PASSED'
E exact match: 'test_scope_dependsfunc_02.py::test_e PASSED'
E nomatch: 'test_scope_dependsfunc_02.py::test_f SKIPPED'
E and: 'test_scope_dependsfunc_02.py::test_f SKIPPED (test_f depends on test...)'
E and: 'test_scope_dependsfunc_02.py::test_g PASSED'
E and: 'test_scope_dependsfunc_02.py::test_h PASSED'
E and: 'test_scope_dependsfunc_02.py::test_i SKIPPED (test_i depends on test_a)'
E and: 'test_scope_dependsfunc_02.py::test_j PASSED'
E and: 'test_scope_dependsfunc_02.py::TestClass::test_a PASSED'
E and: 'test_scope_dependsfunc_02.py::TestClass::test_b FAILED'
E and: 'test_scope_dependsfunc_02.py::TestClass::test_c PASSED'
E and: 'test_scope_dependsfunc_02.py::TestClass::test_d SKIPPED (test_d depe...)'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '____________________________________ test_b ____________________________________'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_b():'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_scope_dependsfunc_01.py:9: AssertionError'
E and: '____________________________________ test_a ____________________________________'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_a():'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_scope_dependsfunc_02.py:6: AssertionError'
E and: '_______________________________ TestClass.test_b _______________________________'
E and: ''
E and: 'self = <test_scope_dependsfunc_02.TestClass object at 0x7f015bdd2490>'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_b(self):'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_scope_dependsfunc_02.py:59: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'FAILED test_scope_dependsfunc_01.py::test_b - assert False'
E and: 'FAILED test_scope_dependsfunc_02.py::test_a - assert False'
E and: 'FAILED test_scope_dependsfunc_02.py::TestClass::test_b - assert False'
E and: '=================== 3 failed, 10 passed, 3 skipped in 0.05s ===================='
E remains unmatched: 'test_scope_dependsfunc_02.py::test_f SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_scope.py:581: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_scope_dependsfunc0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 16 items
test_scope_dependsfunc_01.py::test_a PASSED
test_scope_dependsfunc_01.py::test_b FAILED
test_scope_dependsfunc_01.py::test_c PASSED
test_scope_dependsfunc_01.py::TestClass::test_b PASSED
test_scope_dependsfunc_02.py::test_a FAILED
test_scope_dependsfunc_02.py::test_b PASSED
test_scope_dependsfunc_02.py::test_e PASSED
test_scope_dependsfunc_02.py::test_f SKIPPED (test_f depends on test...)
test_scope_dependsfunc_02.py::test_g PASSED
test_scope_dependsfunc_02.py::test_h PASSED
test_scope_dependsfunc_02.py::test_i SKIPPED (test_i depends on test_a)
test_scope_dependsfunc_02.py::test_j PASSED
test_scope_dependsfunc_02.py::TestClass::test_a PASSED
test_scope_dependsfunc_02.py::TestClass::test_b FAILED
test_scope_dependsfunc_02.py::TestClass::test_c PASSED
test_scope_dependsfunc_02.py::TestClass::test_d SKIPPED (test_d depe...)
=================================== FAILURES ===================================
____________________________________ test_b ____________________________________
@pytest.mark.dependency()
def test_b():
> assert False
E assert False
test_scope_dependsfunc_01.py:9: AssertionError
____________________________________ test_a ____________________________________
@pytest.mark.dependency()
def test_a():
> assert False
E assert False
test_scope_dependsfunc_02.py:6: AssertionError
_______________________________ TestClass.test_b _______________________________
self = <test_scope_dependsfunc_02.TestClass object at 0x7f015bdd2490>
@pytest.mark.dependency()
def test_b(self):
> assert False
E assert False
test_scope_dependsfunc_02.py:59: AssertionError
=========================== short test summary info ============================
FAILED test_scope_dependsfunc_01.py::test_b - assert False
FAILED test_scope_dependsfunc_02.py::test_a - assert False
FAILED test_scope_dependsfunc_02.py::TestClass::test_b - assert False
=================== 3 failed, 10 passed, 3 skipped in 0.05s ====================
_______________________________________________________________________________ test_simple ________________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_simple0')>
def test_simple(ctestdir):
"""One test fails, other dependent tests are skipped.
This also includes indirect dependencies.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency()
def test_a():
pass
@pytest.mark.dependency()
def test_b():
assert False
@pytest.mark.dependency(depends=["test_b"])
def test_c():
pass
@pytest.mark.dependency(depends=["test_c"])
def test_d():
pass
""")
result = ctestdir.runpytest("--verbose", "-rs")
result.assert_outcomes(passed=1, skipped=2, failed=1)
> result.stdout.fnmatch_lines("""
*::test_a PASSED
*::test_b FAILED
*::test_c SKIPPED
*::test_d SKIPPED
""")
E Failed: nomatch: '*::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_simple0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 4 items'
E and: ''
E fnmatch: '*::test_a PASSED'
E with: 'test_simple.py::test_a PASSED'
E fnmatch: '*::test_b FAILED'
E with: 'test_simple.py::test_b FAILED'
E nomatch: '*::test_c SKIPPED'
E and: 'test_simple.py::test_c SKIPPED (test_c depends on test_b)'
E and: 'test_simple.py::test_d SKIPPED (test_d depends on test_c)'
E and: ''
E and: '=================================== FAILURES ==================================='
E and: '____________________________________ test_b ____________________________________'
E and: ''
E and: ' @pytest.mark.dependency()'
E and: ' def test_b():'
E and: '> assert False'
E and: 'E assert False'
E and: ''
E and: 'test_simple.py:9: AssertionError'
E and: '=========================== short test summary info ============================'
E and: 'SKIPPED [1] ../../../../home/tkloczko/rpmbuild/BUILDROOT/python-pytest-dependency-0.5.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_dependency.py:98: test_c depends on test_b'
E and: 'SKIPPED [1] ../../../../home/tkloczko/rpmbuild/BUILDROOT/python-pytest-dependency-0.5.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_dependency.py:98: test_d depends on test_c'
E and: '==================== 1 failed, 1 passed, 2 skipped in 0.01s ===================='
E remains unmatched: '*::test_c SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_03_skipmsgs.py:32: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_simple0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 4 items
test_simple.py::test_a PASSED
test_simple.py::test_b FAILED
test_simple.py::test_c SKIPPED (test_c depends on test_b)
test_simple.py::test_d SKIPPED (test_d depends on test_c)
=================================== FAILURES ===================================
____________________________________ test_b ____________________________________
@pytest.mark.dependency()
def test_b():
> assert False
E assert False
test_simple.py:9: AssertionError
=========================== short test summary info ============================
SKIPPED [1] ../../../../home/tkloczko/rpmbuild/BUILDROOT/python-pytest-dependency-0.5.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_dependency.py:98: test_c depends on test_b
SKIPPED [1] ../../../../home/tkloczko/rpmbuild/BUILDROOT/python-pytest-dependency-0.5.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_dependency.py:98: test_d depends on test_c
==================== 1 failed, 1 passed, 2 skipped in 0.01s ====================
_______________________________________________________________________________ test_not_set _______________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_not_set0')>
def test_not_set(ctestdir):
"""No pytest.ini file, e.g. automark_dependency is not set.
Since automark_dependency defaults to false and test_a is not
marked, the outcome of test_a will not be recorded. As a result,
test_b will be skipped due to a missing dependency.
"""
ctestdir.makepyfile("""
import pytest
def test_a():
pass
@pytest.mark.dependency(depends=["test_a"])
def test_b():
pass
""")
result = ctestdir.runpytest("--verbose", "-rs")
result.assert_outcomes(passed=1, skipped=1, failed=0)
> result.stdout.fnmatch_lines("""
*::test_a PASSED
*::test_b SKIPPED
""")
E Failed: nomatch: '*::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_not_set0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 2 items'
E and: ''
E fnmatch: '*::test_a PASSED'
E with: 'test_not_set.py::test_a PASSED'
E nomatch: '*::test_b SKIPPED'
E and: 'test_not_set.py::test_b SKIPPED (test_b depends on test_a)'
E and: ''
E and: '=========================== short test summary info ============================'
E and: 'SKIPPED [1] ../../../../home/tkloczko/rpmbuild/BUILDROOT/python-pytest-dependency-0.5.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_dependency.py:98: test_b depends on test_a'
E and: '========================= 1 passed, 1 skipped in 0.01s ========================='
E remains unmatched: '*::test_b SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_04_automark.py:26: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_not_set0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 2 items
test_not_set.py::test_a PASSED
test_not_set.py::test_b SKIPPED (test_b depends on test_a)
=========================== short test summary info ============================
SKIPPED [1] ../../../../home/tkloczko/rpmbuild/BUILDROOT/python-pytest-dependency-0.5.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_dependency.py:98: test_b depends on test_a
========================= 1 passed, 1 skipped in 0.01s =========================
______________________________________________________________________________ test_set_false ______________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_set_false0')>
def test_set_false(ctestdir):
"""A pytest.ini is present, automark_dependency is set to false.
Since automark_dependency is set to false and test_a is not
marked, the outcome of test_a will not be recorded. As a result,
test_b will be skipped due to a missing dependency.
"""
ctestdir.makefile('.ini', pytest="""
[pytest]
automark_dependency = false
console_output_style = classic
""")
ctestdir.makepyfile("""
import pytest
def test_a():
pass
@pytest.mark.dependency(depends=["test_a"])
def test_b():
pass
""")
result = ctestdir.runpytest("--verbose", "-rs")
result.assert_outcomes(passed=1, skipped=1, failed=0)
> result.stdout.fnmatch_lines("""
*::test_a PASSED
*::test_b SKIPPED
""")
E Failed: nomatch: '*::test_a PASSED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_set_false0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 2 items'
E and: ''
E fnmatch: '*::test_a PASSED'
E with: 'test_set_false.py::test_a PASSED'
E nomatch: '*::test_b SKIPPED'
E and: 'test_set_false.py::test_b SKIPPED (test_b depends on test_a)'
E and: ''
E and: '=========================== short test summary info ============================'
E and: 'SKIPPED [1] ../../../../home/tkloczko/rpmbuild/BUILDROOT/python-pytest-dependency-0.5.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_dependency.py:98: test_b depends on test_a'
E and: '========================= 1 passed, 1 skipped in 0.01s ========================='
E remains unmatched: '*::test_b SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_04_automark.py:56: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_set_false0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 2 items
test_set_false.py::test_a PASSED
test_set_false.py::test_b SKIPPED (test_b depends on test_a)
=========================== short test summary info ============================
SKIPPED [1] ../../../../home/tkloczko/rpmbuild/BUILDROOT/python-pytest-dependency-0.5.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_dependency.py:98: test_b depends on test_a
========================= 1 passed, 1 skipped in 0.01s =========================
______________________________________________________________________________ test_no_ignore ______________________________________________________________________________
ctestdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-677/test_no_ignore0')>
def test_no_ignore(ctestdir):
"""No command line option, e.g. ignore-unknown-dependency is not set.
Explicitly select only a single test that depends on another one.
Since the other test has not been run at all, the selected test
will be skipped.
"""
ctestdir.makepyfile("""
import pytest
@pytest.mark.dependency()
def test_a():
pass
@pytest.mark.dependency()
def test_b():
pass
@pytest.mark.dependency()
def test_c():
pass
@pytest.mark.dependency(depends=["test_c"])
def test_d():
pass
""")
result = ctestdir.runpytest("--verbose", "test_no_ignore.py::test_d")
result.assert_outcomes(passed=0, skipped=1, failed=0)
> result.stdout.fnmatch_lines("""
*::test_d SKIPPED
""")
E Failed: nomatch: '*::test_d SKIPPED'
E and: '============================= test session starts =============================='
E and: 'platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3'
E and: 'cachedir: .pytest_cache'
E and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_no_ignore0, configfile: pytest.ini'
E and: 'plugins: dependency-0.5.1'
E and: 'collecting ... collected 1 item'
E and: ''
E and: 'test_no_ignore.py::test_d SKIPPED (test_d depends on test_c)'
E and: ''
E and: '============================== 1 skipped in 0.01s =============================='
E remains unmatched: '*::test_d SKIPPED'
/home/tkloczko/rpmbuild/BUILD/pytest-dependency-0.5.1/tests/test_04_ignore_unknown.py:35: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-tkloczko/pytest-677/test_no_ignore0, configfile: pytest.ini
plugins: dependency-0.5.1
collecting ... collected 1 item
test_no_ignore.py::test_d SKIPPED (test_d depends on test_c)
============================== 1 skipped in 0.01s ==============================
========================================================================= short test summary info ==========================================================================
FAILED tests/test_02_simple_dependency.py::test_no_skip - Failed: nomatch: '*::test_a SKIPPED'
FAILED tests/test_02_simple_dependency.py::test_skip_depend - Failed: nomatch: '*::test_a PASSED'
FAILED tests/test_02_simple_dependency.py::test_fail_depend - Failed: nomatch: '*::test_a PASSED'
FAILED tests/test_02_simple_dependency.py::test_named_fail_depend - Failed: nomatch: '*::test_a PASSED'
FAILED tests/test_02_simple_dependency.py::test_explicit_select - Failed: nomatch: '*::test_d SKIPPED'
FAILED tests/test_02_simple_dependency.py::test_depend_unknown - Failed: nomatch: '*::test_a PASSED'
FAILED tests/test_03_class.py::test_class_simple - Failed: nomatch: '*::TestClass::test_a FAILED'
FAILED tests/test_03_class.py::test_class_simple_named - Failed: nomatch: '*::TestClassNamed::test_a FAILED'
FAILED tests/test_03_class.py::test_class_default_name - Failed: nomatch: '*::test_a FAILED'
FAILED tests/test_03_multiple_dependency.py::test_multiple - Failed: nomatch: '*::test_a SKIPPED'
FAILED tests/test_03_param.py::test_multiple - Failed: nomatch: '*::test_a?0-0? PASSED'
FAILED tests/test_03_runtime.py::test_skip_depend_runtime - Failed: nomatch: '*::test_a PASSED'
FAILED tests/test_03_scope.py::test_scope_module - Failed: nomatch: 'test_scope_module.py::test_a FAILED'
FAILED tests/test_03_scope.py::test_scope_session - Failed: nomatch: 'test_scope_session_01.py::test_a PASSED'
FAILED tests/test_03_scope.py::test_scope_package - Failed: nomatch: 'test_scope_package_a/test_01.py::test_a PASSED'
FAILED tests/test_03_scope.py::test_scope_class - Failed: nomatch: 'test_scope_class.py::test_a FAILED'
FAILED tests/test_03_scope.py::test_scope_nodeid - Failed: nomatch: 'test_scope_nodeid.py::test_a PASSED'
FAILED tests/test_03_scope.py::test_scope_named - Failed: nomatch: 'test_scope_named.py::test_a PASSED'
FAILED tests/test_03_scope.py::test_scope_dependsfunc - Failed: nomatch: 'test_scope_dependsfunc_01.py::test_a PASSED'
FAILED tests/test_03_skipmsgs.py::test_simple - Failed: nomatch: '*::test_a PASSED'
FAILED tests/test_04_automark.py::test_not_set - Failed: nomatch: '*::test_a PASSED'
FAILED tests/test_04_automark.py::test_set_false - Failed: nomatch: '*::test_a PASSED'
FAILED tests/test_04_ignore_unknown.py::test_no_ignore - Failed: nomatch: '*::test_d SKIPPED'
======================================================================= 23 failed, 4 passed in 3.38s =======================================================================