test/server_poll.py: use absolute path for test
test/server_poll.py: fix absolute path
This commit is contained in:
parent
8e0d16e746
commit
9abe2f5e74
@ -1,6 +1,8 @@
|
|||||||
import unittest
|
import unittest
|
||||||
import requests
|
import requests
|
||||||
import time
|
import time
|
||||||
|
import os
|
||||||
|
from modules.paths import script_path
|
||||||
|
|
||||||
|
|
||||||
def run_tests(proc, test_dir):
|
def run_tests(proc, test_dir):
|
||||||
@ -15,8 +17,8 @@ def run_tests(proc, test_dir):
|
|||||||
break
|
break
|
||||||
if proc.poll() is None:
|
if proc.poll() is None:
|
||||||
if test_dir is None:
|
if test_dir is None:
|
||||||
test_dir = "test"
|
test_dir = os.path.join(script_path, "test")
|
||||||
suite = unittest.TestLoader().discover(test_dir, pattern="*_test.py", top_level_dir="test")
|
suite = unittest.TestLoader().discover(test_dir, pattern="*_test.py", top_level_dir=test_dir)
|
||||||
result = unittest.TextTestRunner(verbosity=2).run(suite)
|
result = unittest.TextTestRunner(verbosity=2).run(suite)
|
||||||
return len(result.failures) + len(result.errors)
|
return len(result.failures) + len(result.errors)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user