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

Fixtures: Make pgtest truly an optional dependency #6502

Merged

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Jul 1, 2024

The pytest fixtures were improved to allow running with a core.sqlite_dos storage for the test profile, making PostgreSQL completely optional. However, the current fixture still imports the pgtest package at module level making it a requirement, despite it only being relevant when running the tests with a core.psql_dos storage plugin.

Here the import is moved inside the PostgresCluster._create method which is only called when the test suite actually uses a PSQL based storage plugin.

The pytest fixtures were improved to allow running with a
`core.sqlite_dos` storage for the test profile, making PostgreSQL
completely optional. However, the current fixture still imports the
`pgtest` package at module level making it a requirement, despite it
only being relevant when running the tests with a `core.psql_dos`
storage plugin.

Here the import is moved inside the `PostgresCluster._create` method
which is only called when the test suite actually uses a PSQL based
storage plugin.
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.79%. Comparing base (ef60b66) to head (11af096).
Report is 115 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6502      +/-   ##
==========================================
+ Coverage   77.51%   77.79%   +0.29%     
==========================================
  Files         560      561       +1     
  Lines       41444    41811     +367     
==========================================
+ Hits        32120    32522     +402     
+ Misses       9324     9289      -35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sphuber sphuber merged commit 9fe8fd2 into aiidateam:main Jul 1, 2024
11 checks passed
@sphuber sphuber deleted the fix/pytest-fixtures-pgtest-optional branch July 1, 2024 11:33
mikibonacci pushed a commit to mikibonacci/aiida-core that referenced this pull request Sep 3, 2024
The pytest fixtures were improved to allow running with a
`core.sqlite_dos` storage for the test profile, making PostgreSQL
completely optional. However, the current fixture still imports the
`pgtest` package at module level making it a requirement, despite it
only being relevant when running the tests with a `core.psql_dos`
storage plugin.

Here the import is moved inside the `PostgresCluster._create` method
which is only called when the test suite actually uses a PSQL based
storage plugin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant