@@ -215,8 +215,8 @@ def test_chdir(self, testdir):
215215 assert not result .ret
216216
217217 def test_issue109_sibling_conftests_not_loaded (self , testdir ):
218- sub1 = testdir .tmpdir . mkdir ("sub1" )
219- sub2 = testdir .tmpdir . mkdir ("sub2" )
218+ sub1 = testdir .mkdir ("sub1" )
219+ sub2 = testdir .mkdir ("sub2" )
220220 sub1 .join ("conftest.py" ).write ("assert 0" )
221221 result = testdir .runpytest (sub2 )
222222 assert result .ret == EXIT_NOTESTSCOLLECTED
@@ -603,11 +603,11 @@ def test_cmdline_python_namespace_package(self, testdir, monkeypatch):
603603 # The structure of the test directory is now:
604604 # .
605605 # ├── hello
606- # │ └── ns_pkg
607- # │ ├── __init__.py
608- # │ └── hello
609- # │ ├── __init__.py
610- # │ └── test_hello.py
606+ # │ └── ns_pkg
607+ # │ ├── __init__.py
608+ # │ └── hello
609+ # │ ├── __init__.py
610+ # │ └── test_hello.py
611611 # └── world
612612 # └── ns_pkg
613613 # ├── __init__.py
@@ -624,10 +624,9 @@ def join_pythonpath(*dirs):
624624 for p in search_path :
625625 monkeypatch .syspath_prepend (p )
626626
627- os .chdir ('world' )
628627 # mixed module and filenames:
628+ os .chdir ('world' )
629629 result = testdir .runpytest ("--pyargs" , "-v" , "ns_pkg.hello" , "ns_pkg/world" )
630- testdir .chdir ()
631630 assert result .ret == 0
632631 result .stdout .fnmatch_lines ([
633632 "*test_hello.py::test_hello*PASSED*" ,
@@ -638,6 +637,7 @@ def join_pythonpath(*dirs):
638637 ])
639638
640639 # specify tests within a module
640+ testdir .chdir ()
641641 result = testdir .runpytest ("--pyargs" , "-v" , "ns_pkg.world.test_world::test_other" )
642642 assert result .ret == 0
643643 result .stdout .fnmatch_lines ([
0 commit comments