python-jsonrpc-server icon indicating copy to clipboard operation
python-jsonrpc-server copied to clipboard

Test test_writer_bad_message fails when not in UTC timezone

Open juliangilbey opened this issue 5 years ago • 0 comments

The test_writer_bad_message fails when running in a timezone other than UTC, as the timestamp() method presumes that it is local time unless a timezone is specified, and so the assert (which has assumed UTC) fails. This patch fixes this issue.

--- a/test/test_streams.py
+++ b/test/test_streams.py
@@ -119,6 +119,7 @@
         hour=1,
         minute=1,
         second=1,
+        tzinfo=datetime.timezone.utc,
     ))
 
     assert wfile.getvalue() in [

juliangilbey avatar Dec 29 '20 11:12 juliangilbey