Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/bin/start
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -e
cd "$(dirname "${BASH_SOURCE[0]}")/../.."

export PYTHONPATH=.ten/app/ten_packages/system/ten_runtime_python/lib:.ten/app/ten_packages/system/ten_runtime_python/interface
export TEN_DISABLE_ADDON_UNREGISTER_AFTER_APP_CLOSE=true

# If the Python app imports some modules that are compiled with a different
# version of libstdc++ (ex: PyTorch), the Python app may encounter confusing
Expand Down
36 changes: 36 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,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()
Loading