From 0bf363472ed23c42674bc41528fd482a7b73f8d8 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 22 Apr 2019 02:04:07 +0200 Subject: [PATCH] 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. --- src/_pytest/main.py | 2 +- src/_pytest/terminal.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/main.py b/src/_pytest/main.py index df4a7a956..291fb73a4 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -434,7 +434,7 @@ class Session(nodes.FSCollector): self.shouldfail = False self.trace = config.trace.root.get("collection") self._norecursepatterns = config.getini("norecursedirs") - self.startdir = py.path.local() + self.startdir = config.invocation_dir self._initialpaths = frozenset() # Keep track of any collected nodes in here, so we don't duplicate fixtures self._node_cache = {} diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 8d2d65da5..93267a6b8 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -234,7 +234,7 @@ class TerminalReporter(object): self._showfspath = None self.stats = {} - self.startdir = py.path.local() + self.startdir = config.invocation_dir if file is None: file = sys.stdout self._tw = _pytest.config.create_terminal_writer(config, file)