Handle os.chdir() during collection
This commit is contained in:
@@ -603,6 +603,7 @@ class Config(object):
|
||||
self._warn = self.pluginmanager._warn
|
||||
self.pluginmanager.register(self, "pytestconfig")
|
||||
self._configured = False
|
||||
self.cwd = os.getcwd()
|
||||
|
||||
def do_setns(dic):
|
||||
import pytest
|
||||
@@ -847,11 +848,10 @@ class Config(object):
|
||||
args, self.option, namespace=self.option
|
||||
)
|
||||
if not args:
|
||||
cwd = os.getcwd()
|
||||
if cwd == self.rootdir:
|
||||
if self.cwd == self.rootdir:
|
||||
args = self.getini("testpaths")
|
||||
if not args:
|
||||
args = [cwd]
|
||||
args = [self.cwd]
|
||||
self.args = args
|
||||
except PrintHelp:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user