Skip to content
Prev Previous commit
Next Next commit
Make the CLI test a mixin class
  • Loading branch information
LamentXU123 authored Jul 11, 2025
commit 142324a543910df80850f4d77518b43fcd7fdaef
8 changes: 3 additions & 5 deletions Lib/test/test_uuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,9 +1141,7 @@ def test_uuid_weakref(self):
self.assertIs(strong, weak())


class TestUUIDCommandLineRunTime(unittest.TestCase):
uuid = py_uuid

class TestUUIDCommandLineRunTimeMixin:
def do_test_standalone_uuid(self, version):
stdout = io.StringIO()
with contextlib.redirect_stdout(stdout):
Expand Down Expand Up @@ -1244,12 +1242,12 @@ def test_cli_uuid8(self):
self.do_test_standalone_uuid(8)
Comment thread
LamentXU123 marked this conversation as resolved.


class TestUUIDWithoutExtModule(BaseTestUUID, unittest.TestCase):
class TestUUIDWithoutExtModule(TestUUIDCommandLineRunTimeMixin, BaseTestUUID, unittest.TestCase):
uuid = py_uuid


@unittest.skipUnless(c_uuid, 'requires the C _uuid module')
class TestUUIDWithExtModule(BaseTestUUID, unittest.TestCase):
class TestUUIDWithExtModule(TestUUIDCommandLineRunTimeMixin, BaseTestUUID, unittest.TestCase):
uuid = c_uuid

def check_has_stable_libuuid_extractable_node(self):
Expand Down
Loading