fierce-keyboard-9103207/25/2022, 8:33 AM
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-656807/25/2022, 8:44 AM
fierce-keyboard-9103207/25/2022, 8:53 AM
[pytest] ... extra_requirements.add = [ "pytest-django>=4,<5", ]
bitter-ability-3219007/25/2022, 12:35 PM
hundreds-father-40407/25/2022, 2:46 PM
. Last paragraph of https://www.pantsbuild.org/docs/python-test-goal#pytest-version-and-plugins
clean-city-6447207/25/2022, 3:35 PM
at the root of your test directory triggering
? I don’t think we are seeing this problem. We did have to add something like this to our root
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-9103207/25/2022, 11:59 PM
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!
did the trick, thank you!