Open Drau opened 5 years ago
Where's the conftest?
Just above test_1.py :)
In root? Otherwise it's a matter of contest only being used for files below it (and therefore not related to symlinks).
btw: check out tree
for displaying files in a tree-like fashion.
I've just realized what you were asking :) Yes, conftest is located in root, I've updated the comment.
If I remove sym_tests
symlink, all works perfectly.
EDIT: I see now that pytest_generate_tests
is not actually called for tests located in the symlink directory.
But if I define some random fixture in that same conftest file, it is available for tests located in the symlink directory.
If I remove
sym_tests
symlink, all works perfectly.
You mean if you make it a directory instead?
I see now that
pytest_generate_tests
is not actually called for tests located in the symlink directory.
Good find already, and that might be the issue then after all.
Would be great if you could turn this into a (failing) test for pytest already, using testdir
/ runpytest
to show this.
Also check out --collect-only
and/or add print
s into hooks to see what is going on.
pip list
from the virtual environment you are usingWhen symlinks exist in tests directory, the tests inside those files do not have access to fixtures created by pytest_generate_tests
Env: platform linux -- Python 3.6.6, pytest-4.5.0, py-1.7.0, pluggy-0.11.0
Given the fallowing File Tree:
and the fallowing conftest.py:
test_1.py
test_2.py
Running 'pytest -s - - job_id 10' fails on test_2 with:
fixture 'job_id' not found