Replies: 1 comment 7 replies
-
what's the part of that project that you are having difficulty with ? is it how to run alembic programmatically? (see here). or is it how to have data created in tests that is rolled back inside of a transaction? (see here) those are the two integration points for the case you're describing. we dont want to get into having "turnkey" examples because then people just run them as is without understanding them and expect us to support their specific issues. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Following up on this discussion #871.
My idea would be to provide a simple example (on alembic documentation? example repo? example folder on code?) of tests deleting an object from a table with maybe one happy and not-happy path (ie. object does not exist), in a way there is one
pytest.fixture
withscope=session
that creates a database and apply migrations, so that the same database is used on all tests. Another approach would be to generate from current schema from sqlalchemy, but then the actual migrations are not being covered by tests.I could not find after some search a structured python project or cookiecutter that has database integration test with pytest using alembic. I got puzzled by that since should be a fairly common case (or maybe not on public github projects). I also do not found mentions in alembic or pytest documentation. Am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions