Hello community,

here is the log from the commit of package python-python-jsonrpc-server for 
openSUSE:Factory checked in at 2020-05-03 22:46:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-jsonrpc-server (Old)
 and      /work/SRC/openSUSE:Factory/.python-python-jsonrpc-server.new.2738 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-python-jsonrpc-server"

Sun May  3 22:46:48 2020 rev:5 rq:799808 version:0.3.4

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-python-jsonrpc-server/python-python-jsonrpc-server.changes
        2020-03-20 23:54:08.084821742 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-python-jsonrpc-server.new.2738/python-python-jsonrpc-server.changes
      2020-05-03 22:46:52.887111588 +0200
@@ -1,0 +2,7 @@
+Fri May  1 20:06:56 UTC 2020 - Benjamin Greiner <[email protected]>
+
+- fix the unit tests
+  python-jsonrpc-server-pr37.patch
+  gh#palantir/python-jsonrpc-server#37 
+
+-------------------------------------------------------------------
@@ -21 +28 @@
-  in the test suite run log (gh#palantir/python-jsonrpc-serveri#34).
+  in the test suite run log (gh#palantir/python-jsonrpc-server#34).

New:
----
  python-jsonrpc-server-pr37.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-python-jsonrpc-server.spec ++++++
--- /var/tmp/diff_new_pack.IKXdnM/_old  2020-05-03 22:46:53.555112947 +0200
+++ /var/tmp/diff_new_pack.IKXdnM/_new  2020-05-03 22:46:53.559112955 +0200
@@ -29,6 +29,8 @@
 # PATCH-FIX-UPSTREAM remove_testing_warnings.patch 
gh#palantir/python-jsonrpc-server#34 [email protected]
 # remove warnings about deprecated method logging.Logger.warn
 Patch0:         remove_testing_warnings.patch
+# PATCH-FIX-UPSTREAM remove_testing_warnings.patch 
gh#palantir/python-jsonrpc-server#37 [email protected]
+Patch1:         python-jsonrpc-server-pr37.patch
 BuildRequires:  %{python_module mock}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
@@ -65,8 +67,7 @@
 %check
 # Remove pytest addopts
 rm setup.cfg
-# gh#palantir/python-jsonrpc-server#33
-%pytest -k 'not (test_request_error or test_request_cancel or 
test_writer_bad_message)'
+%pytest
 
 %files %{python_files}
 %doc README.rst

++++++ python-jsonrpc-server-pr37.patch ++++++
>From 0a04cc4e9d44233b1038b12d63cd3bd437c2374e Mon Sep 17 00:00:00 2001
From: Benjamin Greiner <[email protected]>
Date: Fri, 1 May 2020 21:46:56 +0200
Subject: [PATCH 1/2] fix endpoint exception lists for Python 3.8 Author:
 @maximbaz according to #33

---
 pyls_jsonrpc/endpoint.py | 1 +
 test/test_endpoint.py    | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pyls_jsonrpc/endpoint.py b/pyls_jsonrpc/endpoint.py
index e8bfb5b..0caf612 100644
--- a/pyls_jsonrpc/endpoint.py
+++ b/pyls_jsonrpc/endpoint.py
@@ -236,6 +236,7 @@ class Endpoint(object):
         if error is not None:
             log.debug("Received error response to message %s: %s", msg_id, 
error)
             request_future.set_exception(JsonRpcException.from_dict(error))
+            return
 
         log.debug("Received result for message %s: %s", msg_id, result)
         request_future.set_result(result)
diff --git a/test/test_endpoint.py b/test/test_endpoint.py
index 47a038b..b954732 100644
--- a/test/test_endpoint.py
+++ b/test/test_endpoint.py
@@ -115,9 +115,9 @@ def test_request_cancel(endpoint, consumer):
         'params': {'id': MSG_ID}
     })
 
-    with pytest.raises(exceptions.JsonRpcException) as exc_info:
+    with pytest.raises((exceptions.JsonRpcException, futures.CancelledError)) 
as exc_info:
         assert future.result(timeout=2)
-    assert exc_info.type == exceptions.JsonRpcRequestCancelled
+    assert exc_info.type in (exceptions.JsonRpcRequestCancelled, 
futures.CancelledError)
 
 
 def test_consume_notification(endpoint, dispatcher):
-- 
2.26.2

>From 5af6e43d0c1fb9a6a29b96d38cfd6dbeec85d0ea Mon Sep 17 00:00:00 2001
From: Benjamin Greiner <[email protected]>
Date: Fri, 1 May 2020 21:50:41 +0200
Subject: [PATCH 2/2] fix test_writer_bad_message not only windows can have
 problems with serializing datetime

---
 test/test_streams.py | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/test/test_streams.py b/test/test_streams.py
index 8c2e93e..480a73b 100644
--- a/test/test_streams.py
+++ b/test/test_streams.py
@@ -97,7 +97,8 @@ def test_writer(wfile, writer):
 
 def test_writer_bad_message(wfile, writer):
     # A datetime isn't serializable(or poorly serializable),
-    # ensure the write method doesn't throw
+    # ensure the write method doesn't throw, but the result could be empty
+    # or the correct datetime
     import datetime
     writer.write(datetime.datetime(
         year=2019,
@@ -108,12 +109,10 @@ def test_writer_bad_message(wfile, writer):
         second=1,
     ))
 
-    if os.name == 'nt':
-        assert wfile.getvalue() == b''
-    else:
-        assert wfile.getvalue() == (
-            b'Content-Length: 10\r\n'
-            b'Content-Type: application/vscode-jsonrpc; charset=utf8\r\n'
-            b'\r\n'
-            b'1546304461'
-        )
+    assert wfile.getvalue() in [
+        b'',
+        b'Content-Length: 10\r\n'
+        b'Content-Type: application/vscode-jsonrpc; charset=utf8\r\n'
+        b'\r\n'
+        b'1546304461'
+    ]
-- 
2.26.2


Reply via email to