Skip to content

Commit 27efcd5

Browse files
committed
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.
1 parent 29eeb9d commit 27efcd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

supervisor/tests/test_process.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_getProcessStateDescription(self):
3939
from supervisor.states import ProcessStates
4040
from supervisor.process import getProcessStateDescription
4141
for statename, code in ProcessStates.__dict__.items():
42-
if isinstance(code, int):
42+
if not statename.startswith("__"):
4343
self.assertEqual(getProcessStateDescription(code), statename)
4444

4545
def test_ctor(self):

0 commit comments

Comments
 (0)