From 6092d3c6e1c99be7a424db72ea144aa8caa0862e Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 25 Feb 2020 03:47:06 +0100 Subject: [PATCH] typing: parseconfig --- src/_pytest/pytester.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index f383e51f6..1d6fbbd96 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -29,6 +29,7 @@ from _pytest.capture import MultiCapture from _pytest.capture import SysCapture from _pytest.compat import TYPE_CHECKING from _pytest.config import _PluggyPlugin +from _pytest.config import Config from _pytest.config import ExitCode from _pytest.fixtures import FixtureRequest from _pytest.main import Session @@ -975,7 +976,7 @@ class Testdir: args.append("--basetemp=%s" % self.tmpdir.dirpath("basetemp")) return args - def parseconfig(self, *args): + def parseconfig(self, *args: Union[str, py.path.local]) -> Config: """Return a new pytest Config instance from given commandline args. This invokes the pytest bootstrapping code in _pytest.config to create @@ -991,7 +992,7 @@ class Testdir: import _pytest.config - config = _pytest.config._prepareconfig(args, self.plugins) + config = _pytest.config._prepareconfig(args, self.plugins) # type: Config # we don't know what the test will do with this half-setup config # object and thus we make sure it gets unconfigured properly in any # case (otherwise capturing could still be active, for example)