File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -611,6 +611,9 @@ def __init__(
611611 self .ssl_context = ssl_context
612612 self .no_handler_status_code = 500
613613
614+ def __repr__ (self ):
615+ return f"<{ self .__class__ .__name__ } host={ self .host } port={ self .port } >"
616+
614617 def clear (self ):
615618 """
616619 Clears and resets the state attributes of the object.
Original file line number Diff line number Diff line change @@ -120,3 +120,7 @@ def test_raises_assertion_error_when_request_was_not_responded(httpserver: Block
120120
121121 assert "/my/path" in str (exc )
122122 assert "no response" in str (exc ).lower ()
123+
124+
125+ def test_repr (httpserver : BlockingHTTPServer ):
126+ assert repr (httpserver ) == f"<BlockingHTTPServer host=localhost port={ httpserver .port } >"
Original file line number Diff line number Diff line change @@ -82,3 +82,7 @@ def test_all_ordered_missing(httpserver: HTTPServer):
8282 assert len (httpserver .ordered_handlers ) == 2
8383 assert len (httpserver .oneshot_handlers ) == 2
8484 assert len (httpserver .handlers ) == 1
85+
86+
87+ def test_repr (httpserver : HTTPServer ):
88+ assert repr (httpserver ) == f"<HTTPServer host=localhost port={ httpserver .port } >"
You can’t perform that action at this time.
0 commit comments