Настройка pytest для корректной работы с django-tenants
Добавлена конфигурация pytest.ini с правильным pythonpath для поддержки Django проекта в подкаталоге myproject. Создан conftest.py для инициализации Django при запуске тестов. Изменения: - Добавлен pytest.ini с настройками DJANGO_SETTINGS_MODULE и pythonpath - Создан myproject/conftest.py для автоматической настройки Django - Удален устаревший orders/tests.py - Обновлен requirements.txt Теперь VS Code корректно обнаруживает все 119 тестов проекта.
This commit is contained in:
11
pytest.ini
Normal file
11
pytest.ini
Normal file
@@ -0,0 +1,11 @@
|
||||
[pytest]
|
||||
DJANGO_SETTINGS_MODULE = myproject.settings
|
||||
python_files = tests.py test_*.py *_tests.py
|
||||
python_classes = Test* *Tests
|
||||
python_functions = test_*
|
||||
testpaths = myproject
|
||||
pythonpath = myproject
|
||||
addopts = --tb=short --strict-markers --reuse-db
|
||||
|
||||
# Django database setup
|
||||
django_find_project = true
|
||||
Reference in New Issue
Block a user