Skip to content

Commit ed91d5f

Browse files
committed
config: set invocation_dir in the constructor already
This allows to make use of it when determining the rootdir etc.
1 parent a72eff5 commit ed91d5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_pytest/config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ def __init__(self, pluginmanager):
609609
self._warn = self.pluginmanager._warn
610610
self.pluginmanager.register(self, "pytestconfig")
611611
self._configured = False
612+
self.invocation_dir = py.path.local()
612613

613614
def do_setns(dic):
614615
import pytest
@@ -731,7 +732,6 @@ def _initini(self, args):
731732
self.rootdir, self.inifile, self.inicfg = r
732733
self._parser.extra_info["rootdir"] = self.rootdir
733734
self._parser.extra_info["inifile"] = self.inifile
734-
self.invocation_dir = py.path.local()
735735
self._parser.addini("addopts", "extra command line options", "args")
736736
self._parser.addini("minversion", "minimally required pytest version")
737737
self._override_ini = ns.override_ini or ()

0 commit comments

Comments
 (0)