Merge remote-tracking branch 'upstream/master' into release-4.3.0
This commit is contained in:
@@ -1206,3 +1206,30 @@ def test_collect_pkg_init_and_file_in_args(testdir):
|
||||
"*2 passed in*",
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
not hasattr(py.path.local, "mksymlinkto"),
|
||||
reason="symlink not available on this platform",
|
||||
)
|
||||
@pytest.mark.parametrize("use_pkg", (True, False))
|
||||
def test_collect_sub_with_symlinks(use_pkg, testdir):
|
||||
sub = testdir.mkdir("sub")
|
||||
if use_pkg:
|
||||
sub.ensure("__init__.py")
|
||||
sub.ensure("test_file.py").write("def test_file(): pass")
|
||||
|
||||
# Create a broken symlink.
|
||||
sub.join("test_broken.py").mksymlinkto("test_doesnotexist.py")
|
||||
|
||||
# Symlink that gets collected.
|
||||
sub.join("test_symlink.py").mksymlinkto("test_file.py")
|
||||
|
||||
result = testdir.runpytest("-v", str(sub))
|
||||
result.stdout.fnmatch_lines(
|
||||
[
|
||||
"sub/test_file.py::test_file PASSED*",
|
||||
"sub/test_symlink.py::test_file PASSED*",
|
||||
"*2 passed in*",
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user