forked from getsentry/sentry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
26 lines (17 loc) · 720 Bytes
/
conftest.py
File metadata and controls
26 lines (17 loc) · 720 Bytes
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
from __future__ import absolute_import
import os
import sys
from hashlib import md5
import pytest
pytest_plugins = ["sentry.utils.pytest"]
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
def pytest_configure(config):
import warnings
# XXX(dramer): Kombu throws a warning due to transaction.commit_manually
# being used
warnings.filterwarnings("error", "", Warning, r"^(?!(|kombu|raven|sentry))")
def pytest_collection_modifyitems(items):
for item in items:
total_groups = int(os.environ.get("TOTAL_TEST_GROUPS", 1))
group_num = int(md5(item.location[0]).hexdigest(), 16) % total_groups
item.add_marker(getattr(pytest.mark, "group_%s" % group_num))