forked from esm-tools/pycmor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
52 lines (44 loc) · 1.54 KB
/
conftest.py
File metadata and controls
52 lines (44 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import logging
import pytest
from tests.utils.constants import TEST_ROOT # noqa: F401
@pytest.fixture(scope="function", autouse=True)
def suppress_third_party_logs():
"""Suppress noisy INFO logs from distributed/dask/prefect during tests.
This runs before every test function to ensure logs are suppressed even
when distributed.Client creates new workers.
"""
# Set WARNING level for all noisy distributed/dask/prefect loggers
loggers_to_suppress = [
"distributed",
"distributed.core",
"distributed.scheduler",
"distributed.nanny",
"distributed.worker",
"distributed.http.proxy",
"distributed.worker.memory",
"distributed.comm",
"prefect",
]
for logger_name in loggers_to_suppress:
logging.getLogger(logger_name).setLevel(logging.WARNING)
pytest_plugins = [
"tests.fixtures.CMIP_Tables_Dir",
"tests.fixtures.CV_Dir",
"tests.fixtures.cmip7_test_data",
"tests.fixtures.config_files",
"tests.fixtures.configs",
"tests.fixtures.datasets",
"tests.fixtures.environment",
"tests.fixtures.example_data.awicm_recom",
"tests.fixtures.example_data.fesom_2p6_pimesh",
"tests.fixtures.example_data.pi_uxarray",
"tests.fixtures.fake_data.fesom_mesh",
"tests.fixtures.fake_filesystem",
"tests.fixtures.sample_rules",
"tests.fixtures.config_files",
"tests.fixtures.CV_Dir",
"tests.fixtures.CMIP_Tables_Dir",
"tests.fixtures.config_files",
"tests.fixtures.CV_Dir",
"tests.fixtures.data_requests",
]