fierce-keyboard-91032
07/25/2022, 8:33 AMshared/utils
folder. Unfortunately the django example github does not seem to have such an example.
When I tried this naively, it seems pytest always want to import some kind of Django settings for the test.curved-television-6568
07/25/2022, 8:44 AMfierce-keyboard-91032
07/25/2022, 8:53 AM[pytest]
...
extra_requirements.add = [
"pytest-django>=4,<5",
]
bitter-ability-32190
07/25/2022, 12:35 PMhundreds-father-404
07/25/2022, 2:46 PMpython_requirement
. Last paragraph of https://www.pantsbuild.org/docs/python-test-goal#pytest-version-and-pluginsclean-city-64472
07/25/2022, 3:35 PMconftest.py
at the root of your test directory triggering pytest-django
? I don’t think we are seeing this problem. We did have to add something like this to our root conftest.py
def pytest_configure(config):
if importlib.util.find_spec("path.to.django.consumer") is not None:
from django.conf import settings
os.environ["DJANGO_SETTINGS_MODULE"] = "path.to.pytest_settings"
settings.DATABASES
fierce-keyboard-91032
07/25/2022, 11:59 PMconftest.py
anywhere in our code yet, so that's not it. Going to try a few things based on the replies here. Thank you very much!pytest.ini
did the trick, thank you!