:thread:responses please to not detract from the c...
# general
b
๐Ÿงตresponses please to not detract from the current convo - I'm looking into a temporary workaround for this issue, specifically I need to set
DJANGO_SETTINGS_MODULE
for specific directories / per-
python_tests
. Maybe someone has a solution for this? I've made some attempts with pytest hooks to no avail
h
cc @happy-kitchen-89482, does this ring a bell? You have more Django experience than me
p
We do that by having a conftest.py file and those call to an common conftest.py file which does common things.
๐Ÿ™Œ 1
Screen Shot 2021-05-04 at 12.56.29 PM.png
h
See https://www.pantsbuild.org/v2.5/docs/python-test-goal#conftestpy for more info on how Pants hooks into conftest.py
p
so ^^ this is the conftest at the module level.
h
This indeed ties in to my upcoming DjancoCon EU workshop
p
and then we have the "common" conftest.py (the one imported in the module local conftest.py):
h
But yeah, instead of setting DJANGO_SETTINGS_MODULE we use the
pytest_configure()
hook in a
conftest.py
in the relevant dir
and we have that hook call
settings.configure(...)
p
looks roughly like this (I redacted a bunch of things, but I think the general idea is understandable):
b
great, thanks! that helps a lot
๐Ÿ™Œ 1