You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It depends on these 2 other tests, which are defined in separate .py files in the same directory:
@pytest.mark.dependency(name="test_leaseAdjCapEmp")
def test_leaseAdjCapEmp(sharecode, expected, dbsession, tables):
dbSession = dbsession
SQLAlcBase = tables
sharesDetailsClass = SQLAlcBase.classes['sharesDetails']
leaseAdjCapEmpObj = leaseAdjCapEmp(sharecode, dbSession, SQLAlcBase)
# IntermediateCalculatedValue tests should actually write to the DB, since other tests rely on these values being there
leaseAdjCapEmpObj.outputValue()
assert leaseAdjCapEmpObj.values.equals(expected)
@pytest.mark.dependency(name="test_leaseLiabilities")
def test_leaseLiabilities(sharecode, expected, dbsession, tables):
dbSession = dbsession
SQLAlcBase = tables
sharesDetailsClass = SQLAlcBase.classes['sharesDetails']
leaseLiab = leaseLiabilities(sharecode, dbSession, SQLAlcBase)
# IntermediateCalculatedValue tests should actually write to the DB, since other tests rely on these values being there
leaseLiab.outputValue()
assert leaseLiab.values.equals(expected)
When I run my tests I get:
SKIPPED [1] /usr/local/lib/python3.8/dist-packages/pytest_dependency.py:104: test_calcGrowthQuality[RTN.L-expected0] depends on tests_calculatedvalues/test_leaseAdjCapEmp.py::test_leaseAdjCapEmp
SKIPPED [1] /usr/local/lib/python3.8/dist-packages/pytest_dependency.py:104: test_calcGrowthQuality[FL-expected1] depends on tests_calculatedvalues/test_leaseAdjCapEmp.py::test_leaseAdjCapEmp
SKIPPED [1] /usr/local/lib/python3.8/dist-packages/pytest_dependency.py:104: test_calcGrowthQuality[ALV.DE-expected2] depends on tests_calculatedvalues/test_leaseAdjCapEmp.py::test_leaseAdjCapEmp
I've read https://pytest-dependency.readthedocs.io/en/stable/scope.html and I assume I've done something wrong with naming the tests, but I can't work out what. To me the name "tests_calculatedvalues/test_leaseLiabilities.py::test_leaseLiabilities" seems like it should be correct.
The text was updated successfully, but these errors were encountered:
I'm running into the same issue. pytest-dependency doesn't alter the execution order of files so, while it enforces the dependencies. PyTest still executes them in alphabetical order.
@tkedwards - you can you use pytest-order (a fork of pytest-ordering I created a few months ago) together with pytest-dependency. It has an option to order tests marked with dependency markers if needed. This way you won't lose the functionality from pytest-dependency (e.g. skipping skipped/failed tests) .
Hi,
I have a test that depends on 2 other tests:
It depends on these 2 other tests, which are defined in separate .py files in the same directory:
When I run my tests I get:
I've read https://pytest-dependency.readthedocs.io/en/stable/scope.html and I assume I've done something wrong with naming the tests, but I can't work out what. To me the name "tests_calculatedvalues/test_leaseLiabilities.py::test_leaseLiabilities" seems like it should be correct.
The text was updated successfully, but these errors were encountered: