def test_hook_proxy(testdir):
 testdir.makepyfile(**{'root/demo-0/test_foo1.py': 'def test1(): pass', 'root/demo-a/test_foo2.py': 'def test1(): pass', 'root/demo-a/conftest.py': '\n            def pytest_ignore_collect(path, config):\n                return True\n            ', 'root/demo-b/test_foo3.py': 'def test1(): pass', 'root/demo-c/test_foo4.py': 'def test1(): pass'})
 result = testdir.runpytest()
 result.stdout.fnmatch_lines(['*test_foo1.py*', '*test_foo3.py*', '*test_foo4.py*', '*3 passed*'])

def test_hook_proxy ( testdir ) : testdir . makepyfile ( ** { 'root/demo-0/test_foo1.py' : 'def test1(): pass' , 'root/demo-a/test_foo2.py' : 'def test1(): pass' , 'root/demo-a/conftest.py' : '\n            def pytest_ignore_collect(path, config):\n                return True\n            ' , 'root/demo-b/test_foo3.py' : 'def test1(): pass' , 'root/demo-c/test_foo4.py' : 'def test1(): pass' } ) result = testdir . runpytest ( ) result . stdout . fnmatch_lines ( [ '*test_foo1.py*' , '*test_foo3.py*' , '*test_foo4.py*' , '*3 passed*' ] )
sessions gethookproxy() would cache conftests incorrectly .