Skip to content

Commit

Permalink
Fix tests on Python 3.13
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cjwatson committed Dec 12, 2024
1 parent 29eeb9d commit 27efcd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion supervisor/tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 27efcd5

Please sign in to comment.