Added options to pytest calls (#23083)
- added more default options to pytest calls in setup.cfg and pytest.ini files. - pytest-json-report's plugin name in pluggy has changed, so added option for multiple names
This commit is contained in:
@@ -9,6 +9,7 @@ only running cms tests.
|
||||
|
||||
import importlib
|
||||
import os
|
||||
import logging
|
||||
import contracts
|
||||
import pytest
|
||||
|
||||
@@ -24,6 +25,11 @@ def pytest_configure(config):
|
||||
"""
|
||||
Do core setup operations from manage.py before collecting tests.
|
||||
"""
|
||||
if config.pluginmanager.hasplugin("pytest_jsonreport") or config.pluginmanager.hasplugin("json-report"):
|
||||
config.pluginmanager.register(DeferPlugin())
|
||||
else:
|
||||
logging.info("pytest did not register json_report correctly")
|
||||
|
||||
if config.getoption('help'):
|
||||
return
|
||||
enable_contracts = os.environ.get('ENABLE_CONTRACTS', False)
|
||||
@@ -34,9 +40,6 @@ def pytest_configure(config):
|
||||
startup = importlib.import_module(startup_module)
|
||||
startup.run()
|
||||
|
||||
if config.pluginmanager.hasplugin("json-report"):
|
||||
config.pluginmanager.register(DeferPlugin())
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True, scope='function')
|
||||
def _django_clear_site_cache():
|
||||
|
||||
Reference in New Issue
Block a user