Replies: 2 comments 7 replies
-
We currently have no concept of external add on test collections This "kinda" is on my todo, but timing wise it will happen at earliest in 14 months |
Beta Was this translation helpful? Give feedback.
2 replies
-
Just from the top of my head: Can you implement |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So the context here is that pytest-alembic is a plugin which tests your migrations. It comes bundled with some number of tests which can automatically run against your migrations.
You can optionally,
from pytest_alembic.tests import test_x, test_y, etc
and pytest will do the rest.Alternatively, you can invoke pytest like
pytest --test-alembic tests
, and it automatically adds the tests to the set of collected tests.Today this works by something along the lines of
This has historically been all well and good, although it does appear to use some internal pytest behavior that i'm not certain is what you're supposed to be doing.
What I think I've recently found is that this strategy may not be playing well with other pytest plugins which use the hooking system. In particular pytest-asyncio makes use of the
pytest_pycollect_makeitem
hook to perform some of its behaviors, which is leading to some issues where these test don't triggerpytest_pycollect_makeitem
which causes downstream fixture resolution problems (i think).So ultimately my question is: Is there a more canonical way of getting the expected behavior i'm looking for with the
--test-alembic
flag? (i.e. where tests not defined within thetests/
dir (for apytest tests/
invocation) are still found/run)pytest_pycollect_makeitem
myself?pytest_collectstart
to pick up the tests automatically, without my having to write apytest.Item
subclass at all?Beta Was this translation helpful? Give feedback.
All reactions