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: Skip db tests unless explicitly specified in -m pattern #24492

Merged
merged 3 commits into from
Dec 30, 2018
Merged

TST: Skip db tests unless explicitly specified in -m pattern #24492

merged 3 commits into from
Dec 30, 2018

Conversation

datapythonista
Copy link
Member

@datapythonista datapythonista commented Dec 30, 2018

Since #24450 we don't skip the db tests if the connection fails. That's useful, because the CI won't fail silently if there is any problem with the databases. But as reported in #24485, it's common to have pymysql or psycopg2 installed locally, but no database connection. This is making the tests fail locally, and the agreed solution is to skip the db tests unless they are explicitly requested.

But pytest doesn't make it easy to skip tests by default when using -m, but this solution should work. Another option would be an --include-db option, but I think it makes reading the expressions in the build very difficult (like, what --only-slow --include-db runs?). With -m the expressions are much clearer (e.g. slow and db), so I think this option is better.

The eval is how pytest itself evaluates the value of the -m parameter.

@datapythonista datapythonista added the Testing pandas testing functions or related to the test suite label Dec 30, 2018
@codecov
Copy link

codecov bot commented Dec 30, 2018

Codecov Report

Merging #24492 into master will decrease coverage by 60.38%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #24492       +/-   ##
===========================================
- Coverage   92.31%   31.92%   -60.39%     
===========================================
  Files         166      166               
  Lines       52412    52412               
===========================================
- Hits        48382    16731    -31651     
- Misses       4030    35681    +31651
Flag Coverage Δ
#multiple 30.31% <0%> (-60.42%) ⬇️
#single 31.92% <0%> (-11.14%) ⬇️
Impacted Files Coverage Δ
pandas/util/_tester.py 23.8% <0%> (ø) ⬆️
pandas/io/formats/latex.py 0% <0%> (-100%) ⬇️
pandas/core/categorical.py 0% <0%> (-100%) ⬇️
pandas/io/sas/sas_constants.py 0% <0%> (-100%) ⬇️
pandas/tseries/plotting.py 0% <0%> (-100%) ⬇️
pandas/tseries/converter.py 0% <0%> (-100%) ⬇️
pandas/io/formats/html.py 0% <0%> (-98.65%) ⬇️
pandas/core/groupby/categorical.py 0% <0%> (-95.46%) ⬇️
pandas/core/reshape/reshape.py 8.06% <0%> (-91.51%) ⬇️
pandas/io/sas/sas7bdat.py 0% <0%> (-91.17%) ⬇️
... and 126 more

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 02a97c0...e918cc8. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 30, 2018

Codecov Report

Merging #24492 into master will decrease coverage by 60.4%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #24492       +/-   ##
===========================================
- Coverage   92.31%   31.91%   -60.41%     
===========================================
  Files         166      166               
  Lines       52387    52387               
===========================================
- Hits        48359    16717    -31642     
- Misses       4028    35670    +31642
Flag Coverage Δ
#multiple 30.3% <0%> (-60.43%) ⬇️
#single 31.91% <0%> (-11.14%) ⬇️
Impacted Files Coverage Δ
pandas/util/_tester.py 23.8% <0%> (ø) ⬆️
pandas/io/formats/latex.py 0% <0%> (-100%) ⬇️
pandas/core/categorical.py 0% <0%> (-100%) ⬇️
pandas/io/sas/sas_constants.py 0% <0%> (-100%) ⬇️
pandas/tseries/plotting.py 0% <0%> (-100%) ⬇️
pandas/tseries/converter.py 0% <0%> (-100%) ⬇️
pandas/io/formats/html.py 0% <0%> (-98.65%) ⬇️
pandas/core/groupby/categorical.py 0% <0%> (-95.46%) ⬇️
pandas/core/reshape/reshape.py 8.06% <0%> (-91.51%) ⬇️
pandas/io/sas/sas7bdat.py 0% <0%> (-91.17%) ⬇️
... and 126 more

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 36ab8c9...a0be122. Read the comment docs.

@gfyoung
Copy link
Member

gfyoung commented Dec 30, 2018

but I think it makes reading the expressions in the build very difficult (like, what --only-slow --include-db runs?)

@datapythonista : I'm confused by the motivation for your changes here...

Where have we defined a flag for --include-db ?

@datapythonista
Copy link
Member Author

good point @gfyoung, I added much more context and references to the previous issues to the description. I think it should be clear now, let me know if it's not.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

minor comment, otherwise lgtm.

pandas/conftest.py Outdated Show resolved Hide resolved
@jreback jreback added this to the 0.24.0 milestone Dec 30, 2018
@jreback
Copy link
Contributor

jreback commented Dec 30, 2018

lgtm. merge on green.

@jreback jreback merged commit 43c4dcd into pandas-dev:master Dec 30, 2018
@jreback
Copy link
Contributor

jreback commented Dec 30, 2018

thanks!

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)
thoo added a commit to thoo/pandas that referenced this pull request Dec 30, 2018
* upstream/master:
  REF/TST: replace capture_stdout with pytest capsys fixture (pandas-dev#24501)
  BUG: fix .iat assignment creates a new column (pandas-dev#24495)
  DOC: add checks on the returns section in the docstrings (pandas-dev#23138) (pandas-dev#23432)
  ENH: Add strings_as_fixed_length parameter for df.to_records() (pandas-dev#18146) (pandas-dev#22229)
  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)
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
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST: psycopg2 errors when running tests locally
3 participants