-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconftest.py
36 lines (31 loc) · 1.06 KB
/
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
33
34
35
36
#
# Copyright © 2025 Agora
# This file is part of TEN Framework, an open source project.
# Licensed under the Apache License, Version 2.0, with certain conditions.
# Refer to the "LICENSE" file in the root directory for more information.
#
import pytest
import sys
import os
from ten import (
unregister_all_addons_and_cleanup,
)
@pytest.fixture(scope="session", autouse=True)
def global_setup_and_teardown():
# Set the environment variable.
os.environ["TEN_DISABLE_ADDON_UNREGISTER_AFTER_APP_CLOSE"] = "true"
# Verify the environment variable is correctly set.
if (
"TEN_DISABLE_ADDON_UNREGISTER_AFTER_APP_CLOSE" not in os.environ
or os.environ["TEN_DISABLE_ADDON_UNREGISTER_AFTER_APP_CLOSE"] != "true"
):
print(
"Failed to set TEN_DISABLE_ADDON_UNREGISTER_AFTER_APP_CLOSE",
file=sys.stderr,
)
sys.exit(1)
# Yield control to the test; after the test execution is complete, continue
# with the teardown process.
yield
# Teardown part.
unregister_all_addons_and_cleanup()