diff --git a/pytest5.patch b/pytest5.patch new file mode 100644 index 0000000..1409bb1 --- /dev/null +++ b/pytest5.patch @@ -0,0 +1,24 @@ +From 04eb49ca8c7302a6dcb1f3b93994e928a260a12b Mon Sep 17 00:00:00 2001 +From: pgjones +Date: Sat, 20 Jul 2019 13:23:03 +0100 +Subject: [PATCH] Update dependencies + +Note that pytest>=5 cannot be used whilst Python 2 is still +supported. This will pass with pytest==5.0.1 though. +--- + test/test_invalid_headers.py | 2 +- + 3 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/test/test_invalid_headers.py b/test/test_invalid_headers.py +index bff071b3..a3799507 100644 +--- a/test/test_invalid_headers.py ++++ b/test/test_invalid_headers.py +@@ -204,7 +204,7 @@ def test_pseudo_headers_rejected_in_trailer(self, frame_factory): + # Raise exception if pseudo header in trailer + with pytest.raises(h2.exceptions.ProtocolError) as e: + c.receive_data(trailer) +- assert "pseudo-header in trailer" in str(e) ++ assert "pseudo-header in trailer" in str(e.value) + + # Test appropriate response frame is generated + expected_frame = frame_factory.build_goaway_frame( diff --git a/python-h2.changes b/python-h2.changes index 74e25bc..4fe9232 100644 --- a/python-h2.changes +++ b/python-h2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jul 26 10:02:54 UTC 2019 - Tomáš Chvátal + +- Add patch to fix building with pytest5 pytest5.patch + ------------------------------------------------------------------- Fri Jul 26 09:58:17 UTC 2019 - Tomáš Chvátal diff --git a/python-h2.spec b/python-h2.spec index 7c31f50..39d6665 100644 --- a/python-h2.spec +++ b/python-h2.spec @@ -25,17 +25,19 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/python-hyper/hyper-h2 Source0: https://files.pythonhosted.org/packages/source/h/h2/h2-%{version}.tar.gz -# test requirements -BuildRequires: %{python_module coverage} +Patch0: pytest5.patch BuildRequires: %{python_module hpack >= 2.3} BuildRequires: %{python_module hyperframe >= 5.2.0} BuildRequires: %{python_module hypothesis} BuildRequires: %{python_module pytest-cov} BuildRequires: %{python_module pytest-xdist} -# https://github.com/python-hyper/hyper-h2/issues/1194 -BuildRequires: %{python_module pytest < 5.0} +BuildRequires: %{python_module pytest} BuildRequires: fdupes +BuildRequires: python-enum34 >= 1.1.6 BuildRequires: python-rpm-macros +%ifpython2 +Requires: python-enum34 >= 1.1.6 +%endif Requires: python-hpack >= 2.3 Requires: python-hyperframe >= 5.2.0 BuildArch: noarch @@ -49,6 +51,7 @@ your programming paradigm. %prep %setup -q -n h2-%{version} +%patch0 -p1 %build %python_build