@pytest.fixture(autouse=True)
def chdir(pytestconfig, request):
 if (u'chdir' in request.funcargnames):
  os.chdir(os.path.dirname(request.module.__file__))

@ pytest . fixture ( autouse = True ) def chdir ( pytestconfig , request ) : if ( u'chdir' in request . funcargnames ) : os . chdir ( os . path . dirname ( request . module . __file__ ) )
context manager which temporarily changes the current directory .