#1642 Fix rootdir option

This commit is contained in:
feuillemorte
2018-01-20 22:30:01 +03:00
parent a7c39c894b
commit 83034bbd48
3 changed files with 12 additions and 34 deletions

View File

@@ -266,21 +266,3 @@ def test_rootdir_option_arg(testdir):
result = testdir.runpytest("--rootdir=root")
result.stdout.fnmatch_lines(["*1 passed*"])
def test_rootdir_option_ini_file(testdir):
rootdir = testdir.mkdir("root")
rootdir.join("spoon.py").write("spoon_number = 1")
testsdir = rootdir.mkdir("tests")
testsdir.join("test_one.py").write("from spoon import spoon_number\ndef test_one():\n assert spoon_number")
result = testdir.runpytest()
result.stdout.fnmatch_lines(["*No module named*spoon*"])
testdir.makeini("""
[pytest]
rootdir=root
""")
result = testdir.runpytest()
result.stdout.fnmatch_lines(["*1 passed*"])
result = testdir.runpytest("--rootdir=ignored_argument")
result.stdout.fnmatch_lines(["*1 passed*"])