summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2018-04-18 15:17:51 +0200
committerThomas Deutschmann <whissi@gentoo.org>2018-04-18 15:22:02 +0200
commitcdf4918d154aa61d1323245c173cc7c08a5d1327 (patch)
tree7062d8026038f59a0bbe5f885b3b60d1dee5e211 /dev-python/py/files
parentsys-block/nbd: Removed automagic patch which was added to upstream. (diff)
downloadgentoo-cdf4918d154aa61d1323245c173cc7c08a5d1327.tar.gz
gentoo-cdf4918d154aa61d1323245c173cc7c08a5d1327.tar.bz2
gentoo-cdf4918d154aa61d1323245c173cc7c08a5d1327.zip
dev-python/py: Fix tests
Closes: https://bugs.gentoo.org/642440 Package-Manager: Portage-2.3.30, Repoman-2.3.9
Diffstat (limited to 'dev-python/py/files')
-rw-r--r--dev-python/py/files/py-1.4.34-skip-broken-pytest3.patch116
1 files changed, 116 insertions, 0 deletions
diff --git a/dev-python/py/files/py-1.4.34-skip-broken-pytest3.patch b/dev-python/py/files/py-1.4.34-skip-broken-pytest3.patch
new file mode 100644
index 000000000000..67b1f4eb95ac
--- /dev/null
+++ b/dev-python/py/files/py-1.4.34-skip-broken-pytest3.patch
@@ -0,0 +1,116 @@
+Backport of https://github.com/pytest-dev/py/commit/3305183b964bded36f9cd43976d22524f6ae15b2
+
+--- a/testing/code/test_assertion.py
++++ b/testing/code/test_assertion.py
+@@ -141,7 +141,10 @@ def test_assert_implicit_multiline():
+ e = exvalue()
+ assert str(e).find('assert [1, 2, 3] !=') != -1
+
+-
++@py.test.mark.xfail(py.test.__version__[0] != "2",
++ reason="broken on modern pytest",
++ run=False
++)
+ def test_assert_with_brokenrepr_arg():
+ class BrokenRepr:
+ def __repr__(self): 0 / 0
+@@ -278,7 +281,10 @@ def test_assert_raise_alias(testdir):
+ ])
+
+
+-@pytest.mark.skipif("sys.version_info < (2,5)")
++@py.test.mark.xfail(py.test.__version__[0] != "2",
++ reason="broken on modern pytest",
++ run=False)
++@py.test.mark.skipif("sys.version_info < (2,5)")
+ def test_assert_raise_subclass():
+ class SomeEx(AssertionError):
+ def __init__(self, *args):
+--- a/testing/code/test_excinfo.py
++++ b/testing/code/test_excinfo.py
+@@ -16,6 +16,13 @@ else:
+
+ import pytest
+ pytest_version_info = tuple(map(int, pytest.__version__.split(".")[:3]))
++
++broken_on_modern_pytest = pytest.mark.xfail(
++ pytest_version_info[0] != 2,
++ reason="this test hasn't been fixed after moving py.code into pytest",
++ run=False
++ )
++
+
+ class TWMock:
+ def __init__(self):
+@@ -355,6 +362,7 @@ class TestFormattedExcinfo:
+ assert lines[0] == "| def f(x):"
+ assert lines[1] == " pass"
+
++ @broken_on_modern_pytest
+ def test_repr_source_excinfo(self):
+ """ check if indentation is right """
+ pr = FormattedExcinfo()
+@@ -657,6 +665,7 @@ raise ValueError()
+ assert p._makepath(__file__) == __file__
+ reprtb = p.repr_traceback(excinfo)
+
++ @broken_on_modern_pytest
+ def test_repr_excinfo_addouterr(self, importasmod):
+ mod = importasmod("""
+ def entry():
+@@ -699,6 +708,7 @@ raise ValueError()
+ assert reprtb.extraline == "!!! Recursion detected (same locals & position)"
+ assert str(reprtb)
+
++ @broken_on_modern_pytest
+ def test_tb_entry_AssertionError(self, importasmod):
+ # probably this test is a bit redundant
+ # as py/magic/testing/test_assertion.py
+@@ -742,6 +752,7 @@ raise ValueError()
+ x = py.builtin._totext(MyRepr())
+ assert x == py.builtin._totext("я", "utf-8")
+
++ @broken_on_modern_pytest
+ def test_toterminal_long(self, importasmod):
+ mod = importasmod("""
+ def g(x):
+@@ -768,6 +779,7 @@ raise ValueError()
+ assert tw.lines[9] == ""
+ assert tw.lines[10].endswith("mod.py:3: ValueError")
+
++ @broken_on_modern_pytest
+ def test_toterminal_long_missing_source(self, importasmod, tmpdir):
+ mod = importasmod("""
+ def g(x):
+@@ -793,6 +805,7 @@ raise ValueError()
+ assert tw.lines[7] == ""
+ assert tw.lines[8].endswith("mod.py:3: ValueError")
+
++ @broken_on_modern_pytest
+ def test_toterminal_long_incomplete_source(self, importasmod, tmpdir):
+ mod = importasmod("""
+ def g(x):
+@@ -818,6 +831,7 @@ raise ValueError()
+ assert tw.lines[7] == ""
+ assert tw.lines[8].endswith("mod.py:3: ValueError")
+
++ @broken_on_modern_pytest
+ def test_toterminal_long_filenames(self, importasmod):
+ mod = importasmod("""
+ def f():
+@@ -863,6 +877,7 @@ raise ValueError()
+ assert tw.stringio.getvalue()
+
+
++ @broken_on_modern_pytest
+ def test_native_style(self):
+ excinfo = self.excinfo_from_exec("""
+ assert 0
+@@ -877,6 +892,7 @@ raise ValueError()
+ if py.std.sys.version_info >= (2, 5):
+ assert s.count('assert 0') == 2
+
++ @broken_on_modern_pytest
+ def test_traceback_repr_style(self, importasmod):
+ mod = importasmod("""
+ def f():