Skip to content
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

Fix #632: calling functions to*() should output by default to stdout #634

Merged
merged 2 commits into from
Nov 23, 2022

Conversation

juarezr
Copy link
Member

@juarezr juarezr commented Nov 22, 2022

This PR has the objective of fixing #632.

Changes

  1. Added a new test for checking output to stdout by default
  2. Fixed the regression on all to*() functions

Checklist

Use this checklist to ensure the quality of pull requests that include new code and/or make changes to existing code.

  • Source Code rules apply:
    • Includes unit tests
    • New functions have docstrings with examples that can be run with doctest
    • New functions are included in API docs
    • Docstrings include notes for any changes to API or behavior
    • All changes are documented in docs/changes.rst
  • Versioning and history tracking rules apply:
    • Using atomic commits when possible
    • Commits are reversible when possible
    • There are no incomplete changes in the pull request
    • There is no accidental garbage added in the source code
  • Testing rules apply:
    • Tested locally using tox / pytest
    • Automated testing passes (see CI)
    • Unit test coverage has not decreased (see Coveralls)
  • State of these changes is:
    • Just a proof of concept
    • Work in progress / Further changes needed
    • Ready to review
    • Ready to merge

@juarezr juarezr linked an issue Nov 22, 2022 that may be closed by this pull request
@coveralls
Copy link

Pull Request Test Coverage Report for Build 3525847841

  • 10 of 12 (83.33%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.001%) to 91.116%

Changes Missing Coverage Covered Lines Changed/Added Lines %
petl/io/sources.py 4 5 80.0%
petl/test/io/test_sources.py 6 7 85.71%
Totals Coverage Status
Change from base Build 3131975355: -0.001%
Covered Lines: 12758
Relevant Lines: 14002

💛 - Coveralls

outp = captured.out
# TODO: capfd works on vscode but not in console/tox
if outp:
assert outp in ( 'foo,bar\r\na,1\r\nb,2\r\n' , 'foo,bar\na,1\nb,2\n' )

Check warning

Code scanning / Pylint (reported by Codacy)

No space allowed after bracket

No space allowed after bracket
outp = captured.out
# TODO: capfd works on vscode but not in console/tox
if outp:
assert outp in ( 'foo,bar\r\na,1\r\nb,2\r\n' , 'foo,bar\na,1\nb,2\n' )

Check warning

Code scanning / Pylint (reported by Codacy)

No space allowed before bracket

No space allowed before bracket
@@ -92,6 +92,17 @@
etl.topickle(tbl, StdoutSource())


def test_stdoutsource_none(capfd):

Check warning

Code scanning / Pylint (reported by Codacy)

Missing function docstring

Missing function docstring
outp = captured.out
# TODO: capfd works on vscode but not in console/tox
if outp:
assert outp in ( 'foo,bar\r\na,1\r\nb,2\r\n' , 'foo,bar\na,1\nb,2\n' )

Check warning

Code scanning / Pylint (reported by Codacy)

No space allowed before comma

No space allowed before comma
@juarezr juarezr requested review from a team and arturponinski November 22, 2022 19:46
@juarezr juarezr merged commit 38234d0 into petl-developers:master Nov 23, 2022
@juarezr juarezr deleted the fix-to-stdout branch November 23, 2022 13:10
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.

tocsv(source=None) does not output to stdout
2 participants