-
Notifications
You must be signed in to change notification settings - Fork 35
Add PostgresNode.__repr__() method #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
testgres/api.py
Outdated
@@ -7,27 +7,27 @@ | |||
edit configuration files, start/stop cluster, execute queries. The | |||
typical flow may look like: | |||
|
|||
>>> with get_new_node() as node: | |||
>>> with get_new_node('test') as node: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO it's better to have at least one example with no args at all. It would show user that literally every arg of get_new_node()
has a decent default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough
testgres/api.py
Outdated
... node.init().start() | ||
... result = node.safe_psql('postgres', 'select 1') | ||
... print(result.decode('utf-8').strip()) | ||
... node.stop() | ||
<testgres.node.PostgresNode object at 0x...> | ||
PostgresNode('test', port=..., base_dir=...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that 'test'
should be prefixed by name=
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally disagree as it makes the whole output 5 symbols larger, but I can make my peace with that : )
Codecov Report
@@ Coverage Diff @@
## master #44 +/- ##
==========================================
+ Coverage 97.23% 97.29% +0.05%
==========================================
Files 16 16
Lines 1340 1368 +28
==========================================
+ Hits 1303 1331 +28
Misses 37 37
Continue to review full report at Codecov.
|
Because current string representation of
PostgresNode
doesn't make much sense. Now it looks something like:Also fixed some examples in comments so that they pass
doctest
.