# HG changeset patch # User ijl <ijl@mailbox.org> # Date 1603927228 0 # Wed Oct 28 23:20:28 2020 +0000 # Node ID b4be18c23afd69d1f50d85511134357201dcc05c # Parent 8a8e4a42d063aef375dd9ff07a551d7278ec6dc7 win_python39_amd64 diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -152,6 +152,21 @@ - checkout: self - template: ./azure-posix.yml +- job: win_python39_amd64 + pool: + vmImage: windows-2019 + variables: + interpreter: C:\hostedtoolcache\windows\Python\3.9.0\x64\python.exe + target: x86_64-pc-windows-msvc + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.9' + addToPath: true + architecture: 'x64' + - checkout: self + - template: ./azure-win.yml + - job: win_python38_amd64 pool: vmImage: windows-2019 diff --git a/test/requirements.txt b/test/requirements.txt --- a/test/requirements.txt +++ b/test/requirements.txt @@ -2,8 +2,8 @@ dataclasses;python_version<"3.7" numpy;platform_machine=="x86_64" and python_version<"3.9" pendulum;sys_platform=="linux" and platform_machine=="x86_64" -psutil +psutil;sys_platform!="windows" and python_version<"3.9" pytest pytz typing_extensions;python_version>="3.6" and python_version<"3.8" -xxhash==1.4.3 # creates non-compact ASCII for test_str_ascii +xxhash==1.4.3;sys_platform!="windows" and python_version<"3.9" # creates non-compact ASCII for test_str_ascii diff --git a/test/test_datetime.py b/test/test_datetime.py --- a/test/test_datetime.py +++ b/test/test_datetime.py @@ -105,7 +105,10 @@ b'["2018-06-01T02:03:04+00:00"]', ) - @unittest.skipIf(sys.version_info < (3, 9), "zoneinfo not available") + @unittest.skipIf( + sys.version_info < (3, 9) or sys.platform.startswith("win"), + "zoneinfo not available", + ) def test_datetime_zoneinfo_positive(self): self.assertEqual( orjson.dumps( @@ -125,7 +128,10 @@ b'["2018-01-01T02:03:04+08:00"]', ) - @unittest.skipIf(sys.version_info < (3, 9), "zoneinfo not available") + @unittest.skipIf( + sys.version_info < (3, 9) or sys.platform.startswith("win"), + "zoneinfo not available", + ) def test_datetime_zoneinfo_negative(self): self.assertEqual( orjson.dumps( diff --git a/test/test_memory.py b/test/test_memory.py --- a/test/test_memory.py +++ b/test/test_memory.py @@ -7,7 +7,10 @@ import unittest from typing import List -import psutil +try: + import psutil +except ImportError: + psutil = None import pytest import orjson @@ -57,6 +60,9 @@ class MemoryTests(unittest.TestCase): + @pytest.mark.skipif( + psutil is None, reason="psutil install broken on win, python3.9, Azure" + ) def test_memory_loads(self): """ loads() memory leak @@ -70,6 +76,9 @@ gc.collect() self.assertTrue(proc.memory_info().rss <= mem + MAX_INCREASE) + @pytest.mark.skipif( + psutil is None, reason="psutil install broken on win, python3.9, Azure" + ) def test_memory_dumps(self): """ dumps() memory leak @@ -84,6 +93,9 @@ gc.collect() self.assertTrue(proc.memory_info().rss <= mem + MAX_INCREASE) + @pytest.mark.skipif( + psutil is None, reason="psutil install broken on win, python3.9, Azure" + ) def test_memory_loads_exc(self): """ loads() memory leak exception without a GC pause @@ -102,6 +114,9 @@ self.assertTrue(proc.memory_info().rss <= mem + MAX_INCREASE) gc.enable() + @pytest.mark.skipif( + psutil is None, reason="psutil install broken on win, python3.9, Azure" + ) def test_memory_dumps_exc(self): """ dumps() memory leak exception without a GC pause @@ -121,6 +136,9 @@ self.assertTrue(proc.memory_info().rss <= mem + MAX_INCREASE) gc.enable() + @pytest.mark.skipif( + psutil is None, reason="psutil install broken on win, python3.9, Azure" + ) def test_memory_dumps_default(self): """ dumps() default memory leak @@ -144,6 +162,9 @@ gc.collect() self.assertTrue(proc.memory_info().rss <= mem + MAX_INCREASE) + @pytest.mark.skipif( + psutil is None, reason="psutil install broken on win, python3.9, Azure" + ) def test_memory_dumps_dataclass(self): """ dumps() dataclass memory leak @@ -157,6 +178,9 @@ gc.collect() self.assertTrue(proc.memory_info().rss <= mem + MAX_INCREASE) + @pytest.mark.skipif( + psutil is None, reason="psutil install broken on win, python3.9, Azure" + ) def test_memory_loads_keys(self): """ loads() memory leak with number of keys causing cache eviction @@ -173,6 +197,9 @@ gc.collect() self.assertTrue(proc.memory_info().rss <= mem + MAX_INCREASE) + @pytest.mark.skipif( + psutil is None, reason="psutil install broken on win, python3.9, Azure" + ) @pytest.mark.skipif(numpy is None, reason="numpy is not installed") def test_memory_dumps_numpy(self): """ diff --git a/test/test_type.py b/test/test_type.py --- a/test/test_type.py +++ b/test/test_type.py @@ -2,7 +2,12 @@ import unittest -import xxhash +import pytest + +try: + import xxhash +except ImportError: + xxhash = None import orjson @@ -73,6 +78,9 @@ orjson.JSONEncodeError, orjson.dumps, b"\xed\xa0\xbd\xed\xba\x80" ) # \ud83d\ude80 + @pytest.mark.skipif( + xxhash is None, reason="xxhash install broken on win, python3.9, Azure" + ) def test_str_ascii(self): """ str is ASCII but not compact