Hello community, here is the log from the commit of package python-pytest4 for openSUSE:Factory checked in at 2019-07-08 14:59:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pytest4 (Old) and /work/SRC/openSUSE:Factory/.python-pytest4.new.4615 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest4" Mon Jul 8 14:59:39 2019 rev:5 rq:713062 version:4.6.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pytest4/python-pytest4.changes 2019-06-18 14:49:53.589671744 +0200 +++ /work/SRC/openSUSE:Factory/.python-pytest4.new.4615/python-pytest4.changes 2019-07-08 14:59:39.622410761 +0200 @@ -1,0 +2,9 @@ +Tue Jul 2 13:27:39 UTC 2019 - Tomáš Chvátal <tchva...@suse.com> + +- Update to 4.6.4: + * #5404: Emit a warning when attempting to unwrap a broken object raises an exception, for easier debugging (#5080). + * #5444: Fix --stepwise mode when the first file passed on the command-line fails to collect. + * #5482: Fix bug introduced in 4.6.0 causing collection errors when passing more than 2 positional arguments to pytest.mark.parametrize. + * #5505: Fix crash when discovery fails while using -p no:terminal. + +------------------------------------------------------------------- Old: ---- pytest-4.6.3.tar.gz New: ---- pytest-4.6.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pytest4.spec ++++++ --- /var/tmp/diff_new_pack.Oeavdu/_old 2019-07-08 14:59:40.326411825 +0200 +++ /var/tmp/diff_new_pack.Oeavdu/_new 2019-07-08 14:59:40.330411830 +0200 @@ -26,7 +26,7 @@ %bcond_with test %endif Name: python-pytest4%{psuffix} -Version: 4.6.3 +Version: 4.6.4 Release: 0 Summary: Python testing tool with autodiscovery and detailed asserts License: MIT @@ -48,7 +48,7 @@ Requires: python-wcwidth Requires(post): update-alternatives Requires(postun): update-alternatives -Conflicts: python-pytest < 4.0 +Conflicts: python-pytest Provides: python-pytest = %{version}-%{release} Obsoletes: python-pytest4-doc BuildArch: noarch @@ -56,7 +56,7 @@ BuildRequires: %{python_module hypothesis} BuildRequires: %{python_module importlib_metadata >= 0.12} BuildRequires: %{python_module pygments-pytest} -BuildRequires: %{python_module pytest >= %{version}} +BuildRequires: %{python_module pytest4 >= %{version}} BuildRequires: %{python_module setuptools_scm} BuildRequires: python-funcsigs BuildRequires: python-mock ++++++ pytest-4.6.3.tar.gz -> pytest-4.6.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/AUTHORS new/pytest-4.6.4/AUTHORS --- old/pytest-4.6.3/AUTHORS 2019-06-11 18:55:18.000000000 +0200 +++ new/pytest-4.6.4/AUTHORS 2019-06-29 04:00:08.000000000 +0200 @@ -135,6 +135,7 @@ Katarzyna Jachim Katerina Koukiou Kevin Cox +Kevin J. Foley Kodi B. Arfer Kostis Anagnostopoulos Kristoffer Nordström diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/CHANGELOG.rst new/pytest-4.6.4/CHANGELOG.rst --- old/pytest-4.6.3/CHANGELOG.rst 2019-06-11 18:55:18.000000000 +0200 +++ new/pytest-4.6.4/CHANGELOG.rst 2019-06-29 04:00:08.000000000 +0200 @@ -18,6 +18,26 @@ .. towncrier release notes start +pytest 4.6.4 (2019-06-28) +========================= + +Bug Fixes +--------- + +- `#5404 <https://github.com/pytest-dev/pytest/issues/5404>`_: Emit a warning when attempting to unwrap a broken object raises an exception, + for easier debugging (`#5080 <https://github.com/pytest-dev/pytest/issues/5080>`__). + + +- `#5444 <https://github.com/pytest-dev/pytest/issues/5444>`_: Fix ``--stepwise`` mode when the first file passed on the command-line fails to collect. + + +- `#5482 <https://github.com/pytest-dev/pytest/issues/5482>`_: Fix bug introduced in 4.6.0 causing collection errors when passing + more than 2 positional arguments to ``pytest.mark.parametrize``. + + +- `#5505 <https://github.com/pytest-dev/pytest/issues/5505>`_: Fix crash when discovery fails while using ``-p no:terminal``. + + pytest 4.6.3 (2019-06-11) ========================= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/PKG-INFO new/pytest-4.6.4/PKG-INFO --- old/pytest-4.6.3/PKG-INFO 2019-06-11 18:55:35.000000000 +0200 +++ new/pytest-4.6.4/PKG-INFO 2019-06-29 04:00:24.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pytest -Version: 4.6.3 +Version: 4.6.4 Summary: pytest: simple powerful testing with Python Home-page: https://docs.pytest.org/en/latest/ Author: Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin and others diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/doc/en/announce/index.rst new/pytest-4.6.4/doc/en/announce/index.rst --- old/pytest-4.6.3/doc/en/announce/index.rst 2019-06-11 18:55:18.000000000 +0200 +++ new/pytest-4.6.4/doc/en/announce/index.rst 2019-06-29 04:00:08.000000000 +0200 @@ -6,6 +6,7 @@ :maxdepth: 2 + release-4.6.4 release-4.6.3 release-4.6.2 release-4.6.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/doc/en/announce/release-4.6.4.rst new/pytest-4.6.4/doc/en/announce/release-4.6.4.rst --- old/pytest-4.6.3/doc/en/announce/release-4.6.4.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/pytest-4.6.4/doc/en/announce/release-4.6.4.rst 2019-06-29 04:00:08.000000000 +0200 @@ -0,0 +1,22 @@ +pytest-4.6.4 +======================================= + +pytest 4.6.4 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. To upgrade:: + + pip install --upgrade pytest + +The full changelog is available at https://docs.pytest.org/en/latest/changelog.html. + +Thanks to all who contributed to this release, among them: + +* Anthony Sottile +* Bruno Oliveira +* Daniel Hahler +* Thomas Grainger +* Zac Hatfield-Dodds + + +Happy testing, +The pytest Development Team diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/src/_pytest/_version.py new/pytest-4.6.4/src/_pytest/_version.py --- old/pytest-4.6.3/src/_pytest/_version.py 2019-06-11 18:55:34.000000000 +0200 +++ new/pytest-4.6.4/src/_pytest/_version.py 2019-06-29 04:00:23.000000000 +0200 @@ -1,4 +1,4 @@ # coding: utf-8 # file generated by setuptools_scm # don't change, don't track in version control -version = '4.6.3' +version = '4.6.4' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/src/_pytest/compat.py new/pytest-4.6.4/src/_pytest/compat.py --- old/pytest-4.6.3/src/_pytest/compat.py 2019-06-11 18:55:18.000000000 +0200 +++ new/pytest-4.6.4/src/_pytest/compat.py 2019-06-29 04:00:08.000000000 +0200 @@ -377,7 +377,7 @@ else: def safe_str(v): - """returns v as string, converting to ascii if necessary""" + """returns v as string, converting to utf-8 if necessary""" try: return str(v) except UnicodeError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/src/_pytest/doctest.py new/pytest-4.6.4/src/_pytest/doctest.py --- old/pytest-4.6.3/src/_pytest/doctest.py 2019-06-11 18:55:18.000000000 +0200 +++ new/pytest-4.6.4/src/_pytest/doctest.py 2019-06-29 04:00:08.000000000 +0200 @@ -8,6 +8,7 @@ import platform import sys import traceback +import warnings from contextlib import contextmanager import pytest @@ -17,6 +18,7 @@ from _pytest.compat import safe_getattr from _pytest.fixtures import FixtureRequest from _pytest.outcomes import Skipped +from _pytest.warning_types import PytestWarning DOCTEST_REPORT_CHOICE_NONE = "none" DOCTEST_REPORT_CHOICE_CDIFF = "cdiff" @@ -374,10 +376,18 @@ else: def _mock_aware_unwrap(obj, stop=None): - if stop is None: - return real_unwrap(obj, stop=_is_mocked) - else: + try: + if stop is None or stop is _is_mocked: + return real_unwrap(obj, stop=_is_mocked) return real_unwrap(obj, stop=lambda obj: _is_mocked(obj) or stop(obj)) + except Exception as e: + warnings.warn( + "Got %r when unwrapping %r. This is usually caused " + "by a violation of Python's object protocol; see e.g. " + "https://github.com/pytest-dev/pytest/issues/5080" % (e, obj), + PytestWarning, + ) + raise inspect.unwrap = _mock_aware_unwrap try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/src/_pytest/mark/structures.py new/pytest-4.6.4/src/_pytest/mark/structures.py --- old/pytest-4.6.3/src/_pytest/mark/structures.py 2019-06-11 18:55:18.000000000 +0200 +++ new/pytest-4.6.4/src/_pytest/mark/structures.py 2019-06-29 04:00:08.000000000 +0200 @@ -104,10 +104,7 @@ return cls(parameterset, marks=[], id=None) @staticmethod - def _parse_parametrize_args(argnames, argvalues, **_): - """It receives an ignored _ (kwargs) argument so this function can - take also calls from parametrize ignoring scope, indirect, and other - arguments...""" + def _parse_parametrize_args(argnames, argvalues, *args, **kwargs): if not isinstance(argnames, (tuple, list)): argnames = [x.strip() for x in argnames.split(",") if x.strip()] force_tuple = len(argnames) == 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/src/_pytest/nodes.py new/pytest-4.6.4/src/_pytest/nodes.py --- old/pytest-4.6.3/src/_pytest/nodes.py 2019-06-11 18:55:18.000000000 +0200 +++ new/pytest-4.6.4/src/_pytest/nodes.py 2019-06-29 04:00:08.000000000 +0200 @@ -329,7 +329,7 @@ # Respect explicit tbstyle option, but default to "short" # (None._repr_failure_py defaults to "long" without "fulltrace" option). - tbstyle = self.config.getoption("tbstyle") + tbstyle = self.config.getoption("tbstyle", "auto") if tbstyle == "auto": tbstyle = "short" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/src/_pytest/stepwise.py new/pytest-4.6.4/src/_pytest/stepwise.py --- old/pytest-4.6.3/src/_pytest/stepwise.py 2019-06-11 18:55:18.000000000 +0200 +++ new/pytest-4.6.4/src/_pytest/stepwise.py 2019-06-29 04:00:08.000000000 +0200 @@ -29,6 +29,7 @@ self.config = config self.active = config.getvalue("stepwise") self.session = None + self.report_status = "" if self.active: self.lastfailed = config.cache.get("cache/stepwise", None) @@ -70,12 +71,6 @@ config.hook.pytest_deselected(items=already_passed) - def pytest_collectreport(self, report): - if self.active and report.failed: - self.session.shouldstop = ( - "Error when collecting test, stopping test execution." - ) - def pytest_runtest_logreport(self, report): # Skip this hook if plugin is not active or the test is xfailed. if not self.active or "xfail" in report.keywords: @@ -104,7 +99,7 @@ self.lastfailed = None def pytest_report_collectionfinish(self): - if self.active and self.config.getoption("verbose") >= 0: + if self.active and self.config.getoption("verbose") >= 0 and self.report_status: return "stepwise: %s" % self.report_status def pytest_sessionfinish(self, session): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/src/pytest.egg-info/PKG-INFO new/pytest-4.6.4/src/pytest.egg-info/PKG-INFO --- old/pytest-4.6.3/src/pytest.egg-info/PKG-INFO 2019-06-11 18:55:34.000000000 +0200 +++ new/pytest-4.6.4/src/pytest.egg-info/PKG-INFO 2019-06-29 04:00:23.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pytest -Version: 4.6.3 +Version: 4.6.4 Summary: pytest: simple powerful testing with Python Home-page: https://docs.pytest.org/en/latest/ Author: Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin and others diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/src/pytest.egg-info/SOURCES.txt new/pytest-4.6.4/src/pytest.egg-info/SOURCES.txt --- old/pytest-4.6.3/src/pytest.egg-info/SOURCES.txt 2019-06-11 18:55:34.000000000 +0200 +++ new/pytest-4.6.4/src/pytest.egg-info/SOURCES.txt 2019-06-29 04:00:24.000000000 +0200 @@ -197,6 +197,7 @@ doc/en/announce/release-4.6.1.rst doc/en/announce/release-4.6.2.rst doc/en/announce/release-4.6.3.rst +doc/en/announce/release-4.6.4.rst doc/en/announce/sprint2016.rst doc/en/example/attic.rst doc/en/example/conftest.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/testing/python/metafunc.py new/pytest-4.6.4/testing/python/metafunc.py --- old/pytest-4.6.3/testing/python/metafunc.py 2019-06-11 18:55:18.000000000 +0200 +++ new/pytest-4.6.4/testing/python/metafunc.py 2019-06-29 04:00:08.000000000 +0200 @@ -1765,3 +1765,16 @@ result.stdout.fnmatch_lines( ["*test_func_a*0*PASS*", "*test_func_a*2*PASS*", "*test_func_b*10*PASS*"] ) + + def test_parametrize_positional_args(self, testdir): + testdir.makepyfile( + """ + import pytest + + @pytest.mark.parametrize("a", [1], False) + def test_foo(a): + pass + """ + ) + result = testdir.runpytest() + result.assert_outcomes(passed=1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/testing/test_config.py new/pytest-4.6.4/testing/test_config.py --- old/pytest-4.6.3/testing/test_config.py 2019-06-11 18:55:18.000000000 +0200 +++ new/pytest-4.6.4/testing/test_config.py 2019-06-29 04:00:08.000000000 +0200 @@ -15,6 +15,7 @@ from _pytest.config.findpaths import determine_setup from _pytest.config.findpaths import get_common_ancestor from _pytest.config.findpaths import getcfg +from _pytest.main import EXIT_INTERRUPTED from _pytest.main import EXIT_NOTESTSCOLLECTED from _pytest.main import EXIT_OK from _pytest.main import EXIT_TESTSFAILED @@ -752,10 +753,10 @@ **{ "conftest": conftest_source, "subdir/conftest": conftest_source, - "subdir/test_foo": """ + "subdir/test_foo": """\ def test_foo(pytestconfig): assert pytestconfig.getini('foo') == 'subdir' - """, + """, } ) @@ -788,6 +789,12 @@ assert "ValueError" in err +def test_no_terminal_discovery_error(testdir): + testdir.makepyfile("raise TypeError('oops!')") + result = testdir.runpytest("-p", "no:terminal", "--collect-only") + assert result.ret == EXIT_INTERRUPTED + + def test_load_initial_conftest_last_ordering(testdir, _config_for_test): pm = _config_for_test.pluginmanager diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/testing/test_doctest.py new/pytest-4.6.4/testing/test_doctest.py --- old/pytest-4.6.3/testing/test_doctest.py 2019-06-11 18:55:18.000000000 +0200 +++ new/pytest-4.6.4/testing/test_doctest.py 2019-06-29 04:00:08.000000000 +0200 @@ -3,11 +3,14 @@ from __future__ import division from __future__ import print_function +import inspect import sys import textwrap import pytest from _pytest.compat import MODULE_NOT_FOUND_ERROR +from _pytest.doctest import _is_mocked +from _pytest.doctest import _patch_unwrap_mock_aware from _pytest.doctest import DoctestItem from _pytest.doctest import DoctestModule from _pytest.doctest import DoctestTextfile @@ -1237,3 +1240,25 @@ ) result = testdir.runpytest("--doctest-modules") result.stdout.fnmatch_lines(["* 1 passed *"]) + + +class Broken: + def __getattr__(self, _): + raise KeyError("This should be an AttributeError") + + +@pytest.mark.skipif(not hasattr(inspect, "unwrap"), reason="nothing to patch") +@pytest.mark.parametrize( # pragma: no branch (lambdas are not called) + "stop", [None, _is_mocked, lambda f: None, lambda f: False, lambda f: True] +) +def test_warning_on_unwrap_of_broken_object(stop): + bad_instance = Broken() + assert inspect.unwrap.__module__ == "inspect" + with _patch_unwrap_mock_aware(): + assert inspect.unwrap.__module__ != "inspect" + with pytest.warns( + pytest.PytestWarning, match="^Got KeyError.* when unwrapping" + ): + with pytest.raises(KeyError): + inspect.unwrap(bad_instance, stop=stop) + assert inspect.unwrap.__module__ == "inspect" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-4.6.3/testing/test_stepwise.py new/pytest-4.6.4/testing/test_stepwise.py --- old/pytest-4.6.3/testing/test_stepwise.py 2019-06-11 18:55:18.000000000 +0200 +++ new/pytest-4.6.4/testing/test_stepwise.py 2019-06-29 04:00:08.000000000 +0200 @@ -157,14 +157,12 @@ assert "test_success PASSED" in stdout -def test_stop_on_collection_errors(broken_testdir): - result = broken_testdir.runpytest( - "-v", - "--strict-markers", - "--stepwise", - "working_testfile.py", - "broken_testfile.py", - ) - - stdout = result.stdout.str() - assert "errors during collection" in stdout +@pytest.mark.parametrize("broken_first", [True, False]) +def test_stop_on_collection_errors(broken_testdir, broken_first): + """Stop during collection errors. Broken test first or broken test last + actually surfaced a bug (#5444), so we test both situations.""" + files = ["working_testfile.py", "broken_testfile.py"] + if broken_first: + files.reverse() + result = broken_testdir.runpytest("-v", "--strict-markers", "--stepwise", *files) + result.stdout.fnmatch_lines("*errors during collection*")