From 0cf67990bb8760e5a40d7150e43a2dd597b18c2a Mon Sep 17 00:00:00 2001 From: helix_xx <630824252@qq.com> Date: Sat, 6 Apr 2024 01:19:15 +0800 Subject: [PATCH 1/3] only test on python-version 3.12 --- .github/workflows/unittest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index e3e7e12..2c9d160 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.12"] os: [ubuntu-latest] include: - { python-version: "pypy-3.10", os: windows-latest } From f0fb7232694bcb991a957c3a2c8645ba8365ec9f Mon Sep 17 00:00:00 2001 From: helix_xx <630824252@qq.com> Date: Sat, 6 Apr 2024 01:22:46 +0800 Subject: [PATCH 2/3] uncomment memoryError test, since github workflow time limit is cancled. --- test/encode_test.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/test/encode_test.py b/test/encode_test.py index b410e5a..6da9a84 100644 --- a/test/encode_test.py +++ b/test/encode_test.py @@ -22,16 +22,15 @@ class A: with self.assertRaises(TypeError): cjson.dumps(case) - # TODO uncomment this later - # # MemoryError - # test_cases = [ - # [1] * 2147483648 - # ] - - # for case in test_cases: - # with self.subTest(msg=f'encoding_fail_test(case={case})'): - # with self.assertRaises(MemoryError): - # cjson.dumps(case) + # MemoryError + test_cases = [ + [1] * 2147483648 + ] + + for case in test_cases: + with self.subTest(msg=f'encoding_fail_test(case={case})'): + with self.assertRaises(MemoryError): + cjson.dumps(case) def test_default(self): import cjson From 96def792565cee1f4a7981024af9fb8b45da43a1 Mon Sep 17 00:00:00 2001 From: helix_xx <630824252@qq.com> Date: Sat, 6 Apr 2024 01:38:50 +0800 Subject: [PATCH 3/3] run benchmark only on python-version 3.12 --- .github/workflows/unittest.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 2c9d160..7b4bb38 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest] include: - { python-version: "pypy-3.10", os: windows-latest } @@ -44,4 +44,8 @@ jobs: - name: run tests id: tests run: | + if [[ "${{ matrix.python-version }}" == "3.12" ]]; then + python test/all_test.py + fi python test/all_test.py --ignore benchmark +