We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0516259 commit 65255bcCopy full SHA for 65255bc
src/crate/client/connection.py
@@ -208,7 +208,7 @@ def _lowest_server_version(self):
208
return lowest or Version("0.0.0")
209
210
def __repr__(self):
211
- return "<Connection {0}>".format(repr(self.client))
+ return f"<{self.__class__.__qualname__} {self.client!r}>"
212
213
def __enter__(self):
214
return self
tests/client/test_connection.py
@@ -75,6 +75,12 @@ def test_connection_mock():
75
"my server",
76
"0.42.0")
77
78
+def test_default_repr():
79
+ """
80
+ Verify default repr dunder method.
81
82
+ conn = connect()
83
+ assert repr(conn) == "<Connection <Client ['http://127.0.0.1:4200']>>"
84
85
def test_with_timezone():
86
"""
0 commit comments