From 2826730854a9c0ec2c3c5a429e9d740cb9eeeb33 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Wed, 25 Oct 2023 13:57:37 +0200 Subject: [PATCH 1/4] Tests under Python 3.12 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 63badb33e..063bd649c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.7, 3.8, 3.9, "3.10", 3.11] + python-version: [3.7, 3.8, 3.9, "3.10", 3.11, 3.12] env: MOLER_DEBUG_THREADS: True steps: From 996b471d1649d691d37d31ee1ef7957c7d3fbb3c Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Thu, 26 Oct 2023 10:11:30 +0200 Subject: [PATCH 2/4] tests fix --- README.md | 2 +- setup.py | 2 ++ test/test_connection_observer.py | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8cc1f3196..dd5e6917f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![image](https://img.shields.io/badge/pypi-v2.15.0-blue.svg)](https://pypi.org/project/moler/) -[![image](https://img.shields.io/badge/python-2.7%20%7C%203.6%20%7C%203.7%20%7C%203.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue.svg)](https://pypi.org/project/moler/) +[![image](https://img.shields.io/badge/python-2.7%20%7C%203.6%20%7C%203.7%20%7C%203.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue.svg)](https://pypi.org/project/moler/) [![Build Status](https://travis-ci.org/nokia/moler.svg?branch=master)](https://travis-ci.org/nokia/moler) [![Coverage Status](https://coveralls.io/repos/github/nokia/moler/badge.svg?branch=master)](https://coveralls.io/github/nokia/moler?branch=master) [![BCH compliance](https://bettercodehub.com/edge/badge/nokia/moler?branch=master)](https://bettercodehub.com/) diff --git a/setup.py b/setup.py index a13491101..acb8deeda 100644 --- a/setup.py +++ b/setup.py @@ -43,6 +43,8 @@ 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Software Development', 'Topic :: Software Development :: Testing', diff --git a/test/test_connection_observer.py b/test/test_connection_observer.py index 053c3bbc5..ebb1b0ef5 100644 --- a/test/test_connection_observer.py +++ b/test/test_connection_observer.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- __author__ = 'Grzegorz Latuszek, Marcin Usielski' -__copyright__ = 'Copyright (C) 2018-2021, Nokia' +__copyright__ = 'Copyright (C) 2018-2023, Nokia' __email__ = 'grzegorz.latuszek@nokia.com, marcin.usielski@nokia.com' import importlib @@ -379,6 +379,8 @@ def test_connection_observer_has_data_received_api(connection_observer_major_bas with pytest.raises(TypeError) as error: hasattr(connection_observer_class(), "data_received") assert "Can't instantiate abstract class {} with abstract method".format( + connection_observer_class.__name__) in str(error.value) or\ + "Can't instantiate abstract class {} without an implementation for abstract method".format( connection_observer_class.__name__) in str(error.value) assert "data_received" in str(error.value) From 2521c12e8cc53b3f3bb04a940c056d3aabf3f0cd Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Thu, 26 Oct 2023 10:35:48 +0200 Subject: [PATCH 3/4] comments --- test/test_connection_observer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_connection_observer.py b/test/test_connection_observer.py index ebb1b0ef5..1f39f2484 100644 --- a/test/test_connection_observer.py +++ b/test/test_connection_observer.py @@ -378,10 +378,10 @@ def test_connection_observer_has_data_received_api(connection_observer_major_bas # only derived ones can have logic "what to do with incoming data" with pytest.raises(TypeError) as error: hasattr(connection_observer_class(), "data_received") - assert "Can't instantiate abstract class {} with abstract method".format( + assert "Can't instantiate abstract class {} with abstract method".format( # <3.12 connection_observer_class.__name__) in str(error.value) or\ "Can't instantiate abstract class {} without an implementation for abstract method".format( - connection_observer_class.__name__) in str(error.value) + connection_observer_class.__name__) in str(error.value) # 3.12 assert "data_received" in str(error.value) # example of derived connection_observer implementing it's "data consumption logic" From c841f418e01637140a679282db35ffdfb3a283c4 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Thu, 26 Oct 2023 10:41:54 +0200 Subject: [PATCH 4/4] removed 2.7 --- .github/workflows/ci.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 063bd649c..2279097a0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,13 +47,8 @@ jobs: which adb echo ----------- test adb simulator adb devices - - name: Test with pytest Python 2.7 - if: ${{ matrix.python-version == '2.7' }} - timeout-minutes: 9 - run: | - python -m pytest -vvvsss test/ - name: Test with pytest - if: ${{ (matrix.python-version != '3.9') && (matrix.python-version != '2.7') }} + if: ${{ matrix.python-version != '3.9' }} timeout-minutes: 9 run: | python -m pytest -vvvsss test/