- Notifications
You must be signed in to change notification settings - Fork35
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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: |
funbringerMar 21, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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 ofget_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 byname=
.
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-io commentedMar 21, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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
.