move conftest visibility tests and their setup into a class, accomodates @nicoddemus 's comment

--HG--
branch : issue616
This commit is contained in:
holger krekel 2015-02-27 09:51:53 +01:00
parent d73e689991
commit 28c2327f73
1 changed files with 74 additions and 75 deletions

View File

@ -259,9 +259,8 @@ def test_conftest_found_with_double_dash(testdir):
""")
# conftest visibility, related to issue616
def _setup_tree(testdir):
class TestConftestVisibility:
def _setup_tree(self, testdir): # for issue616
# example mostly taken from:
# https://mail.python.org/pipermail/pytest-dev/2014-September/002617.html
runner = testdir.mkdir("empty")
@ -335,8 +334,8 @@ def _setup_tree(testdir):
])
@pytest.mark.issue616
def test_parsefactories_relative_node_ids(
testdir, chdir,testarg, expect_ntests_passed):
dirs = _setup_tree(testdir)
self, testdir, chdir,testarg, expect_ntests_passed):
dirs = self._setup_tree(testdir)
print("pytest run in cwd: %s" %(
dirs[chdir].relto(testdir.tmpdir)))
print("pytestarg : %s" %(testarg))