MCPcopy
hub / github.com/django/django / setUpClass

Method setUpClass

tests/mail/test_backends.py:606–619  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

604class SMTPBackendTestsBase(SimpleTestCase):
605 @classmethod
606 def setUpClass(cls):
607 super().setUpClass()
608 # Find a free port.
609 with socket.socket() as s:
610 s.bind(("127.0.0.1", 0))
611 port = s.getsockname()[1]
612 cls.smtp_handler = SMTPHandler()
613 cls.smtp_controller = Controller(
614 cls.smtp_handler,
615 hostname="127.0.0.1",
616 port=port,
617 )
618 cls.smtp_controller.start()
619 cls.addClassCleanup(cls.stop_smtp)
620
621 @classmethod
622 def stop_smtp(cls):

Callers 1

setUpClassMethod · 0.45

Calls 1

SMTPHandlerClass · 0.85

Tested by

no test coverage detected