diff --git a/fix-tests-python-3.5.2.patch b/fix-tests-python-3.5.2.patch new file mode 100644 index 0000000..4f5eca1 --- /dev/null +++ b/fix-tests-python-3.5.2.patch @@ -0,0 +1,28 @@ +diff --git a/websockets/test_protocol.py b/websockets/test_protocol.py +index 2e256c6..312f7e7 100644 +--- a/websockets/test_protocol.py ++++ b/websockets/test_protocol.py +@@ -258,7 +258,10 @@ class CommonTests: + self.run_loop_once() + # The connection is established. + self.assertEqual(self.protocol.local_address, ('host', 4312)) +- get_extra_info.assert_called_once_with('sockname', None) ++ if get_extra_info.call_count == 2: ++ assert get_extra_info.call_args_list == [(('sslcontext',),), (('sockname', None),)] ++ else: ++ get_extra_info.assert_called_once_with('sockname', None) + + def test_remote_address(self): + get_extra_info = unittest.mock.Mock(return_value=('host', 4312)) +@@ -268,7 +271,10 @@ class CommonTests: + self.run_loop_once() + # The connection is established. + self.assertEqual(self.protocol.remote_address, ('host', 4312)) +- get_extra_info.assert_called_once_with('peername', None) ++ if get_extra_info.call_count == 2: ++ assert get_extra_info.call_args_list == [(('sslcontext',),), (('peername', None),)] ++ else: ++ get_extra_info.assert_called_once_with('peername', None) + + def test_open(self): + self.assertTrue(self.protocol.open) diff --git a/python-websockets.spec b/python-websockets.spec index 9fad498..00819b3 100644 --- a/python-websockets.spec +++ b/python-websockets.spec @@ -2,12 +2,15 @@ Name: python-%{pypi_name} Version: 3.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: An implementation of the WebSocket Protocol for python with asyncio License: BSD URL: https://pypi.python.org/pypi/%{pypi_name} Source0: https://pypi.python.org/packages/c5/5c/fd5cbe294146421596459ba7ae55f39972d722e77da4c791fdc25be5c8e8/%{pypi_name}-%{version}.tar.gz +# Some tests fail with Python 3.5.2 This patch fixes them. +# See https://github.com/aaugustin/websockets/issues/123 +Patch0: fix-tests-python-3.5.2.patch BuildArch: noarch BuildRequires: python3-devel >= 3.5 @@ -46,6 +49,7 @@ It requires Python ≥ 3.4 or Python 3.3 with the asyncio module. %setup -qn %{pypi_name}-%{version} # Remove upstream's egg-info rm -rf %{pypi_name}.egg-info +%patch0 -p1 %build @@ -57,7 +61,7 @@ rm -rf %{pypi_name}.egg-info %check -%{__python3} -m unittest +%{__python3} setup.py test %files -n python3-%{pypi_name} @@ -68,6 +72,9 @@ rm -rf %{pypi_name}.egg-info %changelog +* Sun Sep 18 2016 Julien Enselme - 3.2-2 +- Correct tests on Python 3.5.2 + * Sun Sep 18 2016 Julien Enselme - 3.2-1 - Update to 3.2