lemon-helicopter-73409
03/09/2023, 4:53 PMImportError: No module named 'config'
pytest-django could not find a Django project (no manage.py file could be found). You must explicitly add your Django project to the Python path to have it picked up.
Somehow pytest-django can’t figure out where config/settings is? Any help is appreciated!happy-kitchen-89482
03/09/2023, 5:18 PMhappy-kitchen-89482
03/09/2023, 5:18 PMhappy-kitchen-89482
03/09/2023, 5:19 PMhappy-kitchen-89482
03/09/2023, 5:19 PMhappy-kitchen-89482
03/09/2023, 5:20 PMlemon-helicopter-73409
03/09/2023, 5:23 PMconfig module in the pytest-django plugin before it ever gets to the conftest.py, but I could be wrong.lemon-helicopter-73409
03/09/2023, 5:25 PMconfig, mtom and manage.py are at the top level of the repo, and mtom/BUILD is where I set the python_tests target.lemon-helicopter-73409
03/09/2023, 5:28 PMconftest.py filehappy-kitchen-89482
03/09/2023, 5:39 PMhappy-kitchen-89482
03/09/2023, 5:39 PMlemon-helicopter-73409
03/09/2023, 5:40 PMlemon-helicopter-73409
03/09/2023, 5:40 PMdependencies=['config'] to the python_testslemon-helicopter-73409
03/09/2023, 5:41 PMlemon-helicopter-73409
03/09/2023, 5:42 PMhappy-kitchen-89482
03/09/2023, 5:42 PMconftest.py is useful for loading different settings in different tests, but for now there are also other ways to tell pytest-django about your settings, e.g., in an env var (that you will have to punch through to the test via this option: https://www.pantsbuild.org/docs/reference-subprocess-environment#env_varshappy-kitchen-89482
03/09/2023, 5:42 PMhappy-kitchen-89482
03/09/2023, 5:43 PMhappy-kitchen-89482
03/09/2023, 5:43 PMlemon-helicopter-73409
03/09/2023, 5:44 PMhappy-kitchen-89482
03/09/2023, 6:01 PMlemon-helicopter-73409
03/09/2023, 6:02 PMlemon-helicopter-73409
03/09/2023, 6:19 PMlemon-helicopter-73409
03/09/2023, 6:20 PMdependencies=["//:req", 'config'], and give the python_tests target a name…happy-kitchen-89482
03/09/2023, 10:26 PM