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

Use h-testkit #8453

Merged
merged 1 commit into from
Jan 30, 2024
Merged

Use h-testkit #8453

merged 1 commit into from
Jan 30, 2024

Conversation

seanh
Copy link
Contributor

@seanh seanh commented Jan 23, 2024

Instead of duplicating test fixtures.

Depends on hypothesis/cookiecutters#165.

I might want to take a closer look at this one because h contains its own code for integrating factoryboy and sqlalchemy in a different way and it should be letting h-testkit do that now. Might want to straighten that out.

@seanh seanh requested a review from marcospri January 23, 2024 12:40
Instead of duplicating test fixtures.
@@ -126,7 +126,7 @@ commands =
functests: sh bin/create-testdb h_functests
{tests,functests}: python3 -m h.scripts.init_db --delete --create
tests: python -m pytest --cov --cov-report= --cov-fail-under=0 --numprocesses logical --dist loadgroup {posargs:tests/unit/}
functests: pytest {posargs:tests/functional/}
functests: python -m pytest {posargs:tests/functional/}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was necessary to fix an h-testkit import error. This is the more correct form of the command anyway (and what the cookiecutter does)

When h is upgraded to SQLAlchemy 2 we can upgrade this fixture to use the
newer, SQLAlchemy 2 version of the technique:
https://docs.sqlalchemy.org/en/20/orm/session_transaction.html#joining-a-session-into-an-external-transaction-such-as-for-test-suites
When h is upgraded to SQLAlchemy 2 this fixture can be removed and it can
Copy link
Member

Choose a reason for hiding this comment

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

@seanh seanh merged commit 534cca8 into main Jan 30, 2024
9 checks passed
@seanh seanh deleted the use-h-testkit branch January 30, 2024 12:39
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.

2 participants