typing: parseconfig

This commit is contained in:
Daniel Hahler 2020-02-25 03:47:06 +01:00
parent 6c236767e0
commit 6092d3c6e1
1 changed files with 3 additions and 2 deletions

View File

@ -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)