Skip to content

Commit d1887f3

Browse files
Refactor TTS test function and improve import handling
1 parent 18c1521 commit d1887f3

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

tests/test_tts.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,9 @@
66
project_root = Path(__file__).parent.parent
77
sys.path.insert(0, str(project_root))
88

9-
try:
10-
from a4f_local import A4F
11-
except ImportError:
12-
print("ERROR: Could not import A4F. Make sure the package is installed or run from the project root.")
13-
sys.exit(1)
9+
from a4f_local import A4F
1410

15-
def test_simple_tts():
11+
def tts():
1612
"""Runs a simple TTS test compatible with pytest."""
1713
try:
1814
client = A4F()
@@ -41,4 +37,5 @@ def test_simple_tts():
4137
print(f"FAILED: An error occurred during the test: {e}")
4238
raise # Re-raise exception for pytest to capture failure
4339

44-
# No need for __main__ block when using pytest
40+
# if __name__ == "__main__":
41+
# tts()

0 commit comments

Comments
 (0)