Skip to content

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

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

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

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