diff --git a/Lib/test/test_cmd.py b/Lib/test/test_cmd.py index ed3336994edaebb..1793acca299a9fe 100644 --- a/Lib/test/test_cmd.py +++ b/Lib/test/test_cmd.py @@ -271,7 +271,8 @@ def default(self, line): @support.requires_subprocess() class CmdTestReadline(unittest.TestCase): - def setUpClass(): + @classmethod + def setUpClass(cls): # Ensure that the readline module is loaded # If this fails, the test is skipped because SkipTest will be raised readline = import_module('readline') diff --git a/Lib/test/test_dbm_gnu.py b/Lib/test/test_dbm_gnu.py index 6980a7026948035..45f6dd8faad05cd 100644 --- a/Lib/test/test_dbm_gnu.py +++ b/Lib/test/test_dbm_gnu.py @@ -10,8 +10,8 @@ filename = TESTFN class TestGdbm(unittest.TestCase): - @staticmethod - def setUpClass(): + @classmethod + def setUpClass(cls): if support.verbose: print(f"gdbm version: {gdbm.gdbm_version}") diff --git a/Lib/test/test_dtrace.py b/Lib/test/test_dtrace.py index ea5cc7c8871db0a..97fa23cd38c9366 100644 --- a/Lib/test/test_dtrace.py +++ b/Lib/test/test_dtrace.py @@ -454,8 +454,8 @@ class TraceTests: optimize_python = 0 @classmethod - def setUpClass(self): - self.backend.assert_usable() + def setUpClass(cls): + cls.backend.assert_usable() def run_case(self, name): actual_output, expected_output = self.backend.run_case(