-
Notifications
You must be signed in to change notification settings - Fork 48
/
conftest.py
32 lines (26 loc) · 957 Bytes
/
conftest.py
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
"""Common utilities for tests
@author: Jesse Schwartzentruber (:truber)
@license:
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
import importlib
import sys
# Currently, the version of django used here is not supported by python 3.12
# Check that django is available before setting the pytest_plugins otherwise the tests
# will fail.
if importlib.util.find_spec("django"):
pytest_plugins = ["covmanager.tests.conftest"]
def pytest_ignore_collect(collection_path, config):
# 3.12 not supported yet
if sys.version_info >= (3, 12):
rel_path = collection_path.relative_to(config.rootdir)
if rel_path.parts[0] in {
"server",
"Collector",
"EC2Reporter",
"TaskStatusReporter",
}:
return True
return None