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: automatically skip SQL tests if no database is set up #50009

Open
jorisvandenbossche opened this issue Dec 2, 2022 · 1 comment
Open
Labels
IO SQL to_sql, read_sql, read_sql_query Testing pandas testing functions or related to the test suite

Comments

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Dec 2, 2022

I think our goal should still be that the tests "pass" by default (if you followed the instructions to create a dev environment), meaning that the SQL tests should automatically skip if you don't have a database set up.

I don't know if that is easy (because we also don't want to silently skip those tests on CI if for example something goes wrong with the database set up, so we would need a way to force them being run on CI?)

Originally posted by @jorisvandenbossche in #48060 (comment)

@jorisvandenbossche jorisvandenbossche added the Testing pandas testing functions or related to the test suite label Dec 2, 2022
@mroeschke mroeschke added the IO SQL to_sql, read_sql, read_sql_query label Nov 22, 2023
@lopof
Copy link
Contributor

lopof commented Jan 22, 2024

A start could be adding to test_sql.py to run only when the variable "CI" is set (default in github jobs https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables):

if not os.getenv("CI"):
    pytest.skip("Run only in CI", allow_module_level=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO SQL to_sql, read_sql, read_sql_query Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

3 participants