Correct tests on Python 3.5.2

epel9
Julien Enselme 9 years ago
parent bbf4cb3ff7
commit 7be117d224

@ -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)

@ -2,12 +2,15 @@
Name: python-%{pypi_name} Name: python-%{pypi_name}
Version: 3.2 Version: 3.2
Release: 1%{?dist} Release: 2%{?dist}
Summary: An implementation of the WebSocket Protocol for python with asyncio Summary: An implementation of the WebSocket Protocol for python with asyncio
License: BSD License: BSD
URL: https://pypi.python.org/pypi/%{pypi_name} URL: https://pypi.python.org/pypi/%{pypi_name}
Source0: https://pypi.python.org/packages/c5/5c/fd5cbe294146421596459ba7ae55f39972d722e77da4c791fdc25be5c8e8/%{pypi_name}-%{version}.tar.gz 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 BuildArch: noarch
BuildRequires: python3-devel >= 3.5 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} %setup -qn %{pypi_name}-%{version}
# Remove upstream's egg-info # Remove upstream's egg-info
rm -rf %{pypi_name}.egg-info rm -rf %{pypi_name}.egg-info
%patch0 -p1
%build %build
@ -57,7 +61,7 @@ rm -rf %{pypi_name}.egg-info
%check %check
%{__python3} -m unittest %{__python3} setup.py test
%files -n python3-%{pypi_name} %files -n python3-%{pypi_name}
@ -68,6 +72,9 @@ rm -rf %{pypi_name}.egg-info
%changelog %changelog
* Sun Sep 18 2016 Julien Enselme <jujens@jujens.eu> - 3.2-2
- Correct tests on Python 3.5.2
* Sun Sep 18 2016 Julien Enselme <jujens@jujens.eu> - 3.2-1 * Sun Sep 18 2016 Julien Enselme <jujens@jujens.eu> - 3.2-1
- Update to 3.2 - Update to 3.2

Loading…
Cancel
Save