Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
funbringer merged 3 commits intopostgrespro:masterfromzilder:node_repr
Mar 22, 2018

Conversation

zilder
Copy link
Collaborator

Because current string representation ofPostgresNode 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 passdoctest.

@@ -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

@funbringerfunbringerMar 21, 2018
edited
Loading

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.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Fair enough

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

Copy link
CollaboratorAuthor

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 commentedMar 21, 2018
edited
Loading

Codecov Report

Merging#44 intomaster willincrease coverage by0.05%.
The diff coverage is100%.

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 FilesCoverage Δ
testgres/config.py97.26% <ø> (ø)⬆️
testgres/api.py100% <ø> (ø)⬆️
tests/test_simple.py99.77% <100%> (ø)⬆️
testgres/node.py97.58% <100%> (+0.08%)⬆️
testgres/consts.py100% <0%> (ø)⬆️

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update7251c95...749de80. Read thecomment docs.

@funbringerfunbringer merged commit7d724ac intopostgrespro:masterMar 22, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@funbringerfunbringerfunbringer requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@zilder@codecov-io@funbringer

[8]ページ先頭

©2009-2025 Movatter.jp