Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

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

Merged
merged 3 commits into from
Mar 22, 2018
Merged

Conversation

zilder
Copy link
Collaborator

@zilder zilder commented Mar 21, 2018

Because current string representation of PostgresNode doesn't make much sense. Now it looks something like:

PostgresNode('test', port=26144, base_dir=/tmp/tgsn_LsaCM1)

Also fixed some examples in comments so that they pass doctest.

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:
Copy link
Collaborator

@funbringer funbringer Mar 21, 2018

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.

Copy link
Collaborator Author

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=...)
Copy link
Collaborator

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=.

Copy link
Collaborator Author

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
Copy link

codecov-io commented Mar 21, 2018

Codecov Report

Merging #44 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
testgres/config.py 97.26% <ø> (ø) ⬆️
testgres/api.py 100% <ø> (ø) ⬆️
tests/test_simple.py 99.77% <100%> (ø) ⬆️
testgres/node.py 97.58% <100%> (+0.08%) ⬆️
testgres/consts.py 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7251c95...749de80. Read the comment docs.

@funbringer funbringer merged commit 7d724ac into postgrespro:master Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants