From b3bb60468331d49ff3eaa3241adb9fa070c90d19 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 23 Oct 2019 20:01:04 +0200 Subject: [PATCH 1/3] fix typo in _issue_warning_captured doc --- src/_pytest/warnings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/warnings.py b/src/_pytest/warnings.py index 8fdb61c2b..8ac1ee225 100644 --- a/src/_pytest/warnings.py +++ b/src/_pytest/warnings.py @@ -138,7 +138,7 @@ def _issue_warning_captured(warning, hook, stacklevel): """ This function should be used instead of calling ``warnings.warn`` directly when we are in the "configure" stage: at this point the actual options might not have been set, so we manually trigger the pytest_warning_captured - hook so we can display this warnings in the terminal. This is a hack until we can sort out #2891. + hook so we can display these warnings in the terminal. This is a hack until we can sort out #2891. :param warning: the warning instance. :param hook: the hook caller From 55bc084dcc783bda88a221a5437a515df3e7b2ae Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 31 Oct 2019 04:39:07 +0100 Subject: [PATCH 2/3] doc: s/_pytest.config.Parser/_pytest.config.argparsing.Parser/ --- src/_pytest/config/__init__.py | 2 +- src/_pytest/config/argparsing.py | 2 +- src/_pytest/hookspec.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 8e11b56e5..e94bec5d6 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -974,7 +974,7 @@ class Config: def getini(self, name: str): """ return configuration value from an :ref:`ini file `. If the specified name hasn't been registered through a prior - :py:func:`parser.addini <_pytest.config.Parser.addini>` + :py:func:`parser.addini <_pytest.config.argparsing.Parser.addini>` call (usually from a plugin), a ValueError is raised. """ try: return self._inicache[name] diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index 9b526ff3e..4eec6be05 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -47,7 +47,7 @@ class Parser: The returned group object has an ``addoption`` method with the same signature as :py:func:`parser.addoption - <_pytest.config.Parser.addoption>` but will be shown in the + <_pytest.config.argparsing.Parser.addoption>` but will be shown in the respective group in the output of ``pytest. --help``. """ for group in self._groups: diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index 8b45c5f9b..03e060eb8 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -45,10 +45,10 @@ def pytest_addoption(parser, pluginmanager): files situated at the tests root directory due to how pytest :ref:`discovers plugins during startup `. - :arg _pytest.config.Parser parser: To add command line options, call - :py:func:`parser.addoption(...) <_pytest.config.Parser.addoption>`. + :arg _pytest.config.argparsing.Parser parser: To add command line options, call + :py:func:`parser.addoption(...) <_pytest.config.argparsing.Parser.addoption>`. To add ini-file values call :py:func:`parser.addini(...) - <_pytest.config.Parser.addini>`. + <_pytest.config.argparsing.Parser.addini>`. :arg _pytest.config.PytestPluginManager pluginmanager: pytest plugin manager, which can be used to install :py:func:`hookspec`'s or :py:func:`hookimpl`'s @@ -148,7 +148,7 @@ def pytest_load_initial_conftests(early_config, parser, args): :param _pytest.config.Config early_config: pytest config object :param list[str] args: list of arguments passed on the command line - :param _pytest.config.Parser parser: to add command line options + :param _pytest.config.argparsing.Parser parser: to add command line options """ From 772dfc4f9d610ebd735be48fd1c0924384c94e04 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 13 Nov 2019 23:24:17 +0100 Subject: [PATCH 3/3] terminal: fix/remove wrong typing for currentfspath Can be -2, or py.path.local (not typed). --- src/_pytest/terminal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 59f0fe0f3..a84733d45 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -254,7 +254,7 @@ class TerminalReporter: # self.writer will be deprecated in pytest-3.4 self.writer = self._tw self._screen_width = self._tw.fullwidth - self.currentfspath = None # type: Optional[int] + self.currentfspath = None # type: Any self.reportchars = getreportopt(config) self.hasmarkup = self._tw.hasmarkup self.isatty = file.isatty()