-
-
Notifications
You must be signed in to change notification settings - Fork 205
Expand file tree
/
Copy pathtest_unit.py
More file actions
44 lines (37 loc) · 1.33 KB
/
test_unit.py
File metadata and controls
44 lines (37 loc) · 1.33 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
import os
import pytest
from . import run
from .conditions import has_http
def test_unit(cmake, unittest):
if unittest in ["basic_transport_thread_name", "cache_keep"]:
pytest.skip("excluded from unit test-suite")
cwd = cmake(
["sentry_test_unit"],
{"SENTRY_BACKEND": "none", "SENTRY_TRANSPORT": "none"},
)
env = dict(os.environ)
run(cwd, "sentry_test_unit", ["--no-summary", unittest], env=env)
@pytest.mark.skipif(not has_http, reason="tests need http transport")
def test_unit_transport(cmake, unittest):
if unittest in [
"custom_logger",
"logger_enable_disable_functionality",
"logger_level",
]:
pytest.skip("excluded from transport test-suite")
cwd = cmake(
["sentry_test_unit"],
{"SENTRY_BACKEND": "none"},
)
env = dict(os.environ)
run(cwd, "sentry_test_unit", ["--no-summary", unittest], env=env)
def test_unit_with_test_path(cmake, unittest):
if unittest in ["basic_transport_thread_name", "cache_keep"]:
pytest.skip("excluded from unit test-suite")
cwd = cmake(
["sentry_test_unit"],
{"SENTRY_BACKEND": "none", "SENTRY_TRANSPORT": "none"},
cflags=['-DSENTRY_TEST_PATH_PREFIX=\\"./\\"'],
)
env = dict(os.environ)
run(cwd, "sentry_test_unit", ["--no-summary", unittest], env=env)