From 27efcd59b454e4f3a81e5e1b02ab0d8d0ff2f45f Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 12 Dec 2024 22:31:34 +0000 Subject: [PATCH] Fix tests on Python 3.13 Python 3.13 added a `__firstlineno__` attribute to classes (https://docs.python.org/3/reference/datamodel.html#type.__firstlineno__) whose value is an int, so the approach taken by `SubprocessTests.test_getProcessStateDescription` to test only actual states no longer works. Exclude all attributes starting with `__` instead. --- supervisor/tests/test_process.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/tests/test_process.py b/supervisor/tests/test_process.py index d9370e24c..24643b4dc 100644 --- a/supervisor/tests/test_process.py +++ b/supervisor/tests/test_process.py @@ -39,7 +39,7 @@ def test_getProcessStateDescription(self): from supervisor.states import ProcessStates from supervisor.process import getProcessStateDescription for statename, code in ProcessStates.__dict__.items(): - if isinstance(code, int): + if not statename.startswith("__"): self.assertEqual(getProcessStateDescription(code), statename) def test_ctor(self):