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

TST: use capsys.readouterr() as named tuple #24489

Merged
merged 1 commit into from
Dec 30, 2018

Conversation

simonjayhawkins
Copy link
Member

currently only one test in codebase uses capsys.readouterr().

from pytest 3.3, the return value from readouterr changed to a namedtuple with two attributes, out and err.

this change in the style of https://docs.pytest.org/en/latest/capture.html#accessing-captured-output-from-a-test-function is to ensure that the current usage in the codebase does not set a precedent for future usage.

@codecov
Copy link

codecov bot commented Dec 29, 2018

Codecov Report

Merging #24489 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24489   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         166      166           
  Lines       52386    52386           
=======================================
  Hits        48357    48357           
  Misses       4029     4029
Flag Coverage Δ
#multiple 90.73% <ø> (ø) ⬆️
#single 43.07% <ø> (ø) ⬆️

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 41b2b18...47b8ffe. Read the comment docs.

3 similar comments
@codecov
Copy link

codecov bot commented Dec 29, 2018

Codecov Report

Merging #24489 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24489   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         166      166           
  Lines       52386    52386           
=======================================
  Hits        48357    48357           
  Misses       4029     4029
Flag Coverage Δ
#multiple 90.73% <ø> (ø) ⬆️
#single 43.07% <ø> (ø) ⬆️

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 41b2b18...47b8ffe. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 29, 2018

Codecov Report

Merging #24489 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24489   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         166      166           
  Lines       52386    52386           
=======================================
  Hits        48357    48357           
  Misses       4029     4029
Flag Coverage Δ
#multiple 90.73% <ø> (ø) ⬆️
#single 43.07% <ø> (ø) ⬆️

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 41b2b18...47b8ffe. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 29, 2018

Codecov Report

Merging #24489 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24489   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         166      166           
  Lines       52386    52386           
=======================================
  Hits        48357    48357           
  Misses       4029     4029
Flag Coverage Δ
#multiple 90.73% <ø> (ø) ⬆️
#single 43.07% <ø> (ø) ⬆️

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 41b2b18...47b8ffe. Read the comment docs.

@gfyoung gfyoung added Refactor Internal refactoring of code Testing pandas testing functions or related to the test suite labels Dec 30, 2018
Copy link
Member

@gfyoung gfyoung left a comment

Choose a reason for hiding this comment

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

This seems like a reasonable change.

cc @jreback

I wonder though: could we use this fixture to replace our existing capture_stdout and capture_stderr decorators in util/testing? Does it suppress displaying the output written to stdout / stderr ?

@jreback
Copy link
Contributor

jreback commented Dec 30, 2018

@gfyoung #24489 (review) is in some separate PRs

@jreback jreback added this to the 0.24.0 milestone Dec 30, 2018
@jreback jreback merged commit 46ca395 into pandas-dev:master Dec 30, 2018
@jreback
Copy link
Contributor

jreback commented Dec 30, 2018

thanks!

@simonjayhawkins simonjayhawkins deleted the capsys branch December 30, 2018 19:31
thoo added a commit to thoo/pandas that referenced this pull request Dec 30, 2018
* upstream/master:
  DOC: Fixing broken references in the docs (pandas-dev#24497)
  DOC: Splitting api.rst in several files (pandas-dev#24462)
  Fix misdescription in escapechar (pandas-dev#24490)
  Floor and ceil methods during pandas.eval which are provided by numexpr (pandas-dev#24355)
  BUG: Pandas any() returning false with true values present (GH pandas-dev#23070) (pandas-dev#24434)
  Misc separable pieces of pandas-dev#24024 (pandas-dev#24488)
  use capsys.readouterr() as named tuple (pandas-dev#24489)
  REF/TST: replace capture_stderr with pytest capsys fixture (pandas-dev#24496)
  TST- Fixing issue with test_parquet test unexpectedly passing (pandas-dev#24480)
  DOC: Doc build for a single doc made much faster, and clean up (pandas-dev#24428)
  BUG: Fix+test timezone-preservation in DTA.repeat (pandas-dev#24483)
  Implement reductions from pandas-dev#24024 (pandas-dev#24484)
thoo added a commit to thoo/pandas that referenced this pull request Dec 30, 2018
…strings

* upstream/master:
  TST: Skip db tests unless explicitly specified in -m pattern (pandas-dev#24492)
  Mix EA into DTA/TDA; part of 24024 (pandas-dev#24502)
  DOC: Fix building of a single API document (pandas-dev#24506)
  DOC: Fixing broken references in the docs (pandas-dev#24497)
  DOC: Splitting api.rst in several files (pandas-dev#24462)
  Fix misdescription in escapechar (pandas-dev#24490)
  Floor and ceil methods during pandas.eval which are provided by numexpr (pandas-dev#24355)
  BUG: Pandas any() returning false with true values present (GH pandas-dev#23070) (pandas-dev#24434)
  Misc separable pieces of pandas-dev#24024 (pandas-dev#24488)
  use capsys.readouterr() as named tuple (pandas-dev#24489)
  REF/TST: replace capture_stderr with pytest capsys fixture (pandas-dev#24496)
  TST- Fixing issue with test_parquet test unexpectedly passing (pandas-dev#24480)
  DOC: Doc build for a single doc made much faster, and clean up (pandas-dev#24428)
  BUG: Fix+test timezone-preservation in DTA.repeat (pandas-dev#24483)
  Implement reductions from pandas-dev#24024 (pandas-dev#24484)
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants