Skip to content

Commit 0bf3634

Browse files
committed
Use config_invocation_dir for startdirs
`Session.startdir` and `TerminalReporter.startdir` appear to be redundant given `Config.invocation_dir`. Keep them for backward compatibility reasons, but use `config.invocation_dir` for them.
1 parent 1460ad6 commit 0bf3634

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/_pytest/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def __init__(self, config):
434434
self.shouldfail = False
435435
self.trace = config.trace.root.get("collection")
436436
self._norecursepatterns = config.getini("norecursedirs")
437-
self.startdir = py.path.local()
437+
self.startdir = config.invocation_dir
438438
self._initialpaths = frozenset()
439439
# Keep track of any collected nodes in here, so we don't duplicate fixtures
440440
self._node_cache = {}

src/_pytest/terminal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def __init__(self, config, file=None):
234234
self._showfspath = None
235235

236236
self.stats = {}
237-
self.startdir = py.path.local()
237+
self.startdir = config.invocation_dir
238238
if file is None:
239239
file = sys.stdout
240240
self._tw = _pytest.config.create_terminal_writer(config, file)

0 commit comments

Comments
 (0)