From 1680cacf49f4cbc55fda9778b51e0de297e18de0 Mon Sep 17 00:00:00 2001 From: Nigel Dokter Date: Mon, 29 Jan 2024 14:25:39 +0100 Subject: [PATCH] fix protocol unit test for python3.12 (#148) * fix protocol unit test for python3.12 * add workflow test for python 3.12 --- .github/workflows/tests.yml | 1 + test/test_protocol.py | 2 +- tox.ini | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 65f86d1..91cf3e9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,6 +17,7 @@ jobs: - '3.9' - '3.10' - '3.11' + - '3.12' name: Python ${{ matrix.python-version }} steps: diff --git a/test/test_protocol.py b/test/test_protocol.py index 1e7440b..7846b32 100644 --- a/test/test_protocol.py +++ b/test/test_protocol.py @@ -68,6 +68,6 @@ class ProtocolTest(unittest.TestCase): # 2nd call of keep_alive should close the transport self.protocol.keep_alive() - assert mock_transport.close.called_once() + mock_transport.close.assert_called_once() self.protocol.connection_lost(None) diff --git a/tox.ini b/tox.ini index 533aa72..59d57e7 100644 --- a/tox.ini +++ b/tox.ini @@ -6,6 +6,7 @@ deps= pytest-asyncio pytest-mock dlms_cosem + setuptools commands= py.test --cov=dsmr_parser test {posargs} pylama dsmr_parser test