Skip to content

TST: Run tests using a database explicitly #23928

Closed
@datapythonista

Description

@datapythonista

At the moment, our tests accessing a database (in pandas/tests/io/test_sql.py) are being skipped if the module to connect to the database are not installed (e.g. pymysql or psycopg2), or if the connection to the database doesn't succeed.

This has two implications:

  • It's not easy in the CI to know which builds are running the db tests (we need to check for the dependencies, and also check if a db server is set up in the host)
  • If there is an issue with the db, the tests will be skipped silently (we'll log that they are skipped, but I guess nobody will notice)

I think a better approach would be:

  • Mark those tests in the cateogry db (i.e. @pytest.mark.db)
  • Remove the skips for when the the connection fails (and possibly the one for when the db modules are not installed)
  • In the CI add -m "not db" or -m "db" depending on whether we want to run the tests or not (this will be done with the env PATTERNS when TST/CI: Unify CI test scripts (single and multi) and simplify the system #23924 is merged)

@jreback is this ok?

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIContinuous IntegrationTestingpandas testing functions or related to the test suitegood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions