summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2024-08-25 13:45:13 +0200
committerjaseg <git@jaseg.de>2024-08-25 13:45:13 +0200
commite6e9313af38dc4e6f650ac893b712eaa058b0b5a (patch)
treef67024b817ee868a44d4253a9d54f0d888b6f57e /tests
parent16cd0b338e50419713b2d7bd8fea956cb593c303 (diff)
downloadpython-mpv-main.tar.gz
python-mpv-main.tar.bz2
python-mpv-main.zip
Tests: Fix race condition in test_wait_for_property_concurrencymain
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_mpv.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_mpv.py b/tests/test_mpv.py
index a59ade1..9c42332 100755
--- a/tests/test_mpv.py
+++ b/tests/test_mpv.py
@@ -49,7 +49,8 @@ def timed_print():
start_time = time.time()
def do_print(level, prefix, text):
td = time.time() - start_time
- print('{:.3f} [{}] {}: {}'.format(td, level, prefix, text), flush=True)
+ print('{:.3f} [{}] {}: {}'.format(td, level, prefix, text.strip()), flush=True)
+ return do_print
class MpvTestCase(unittest.TestCase):
@@ -922,11 +923,10 @@ class RegressionTests(MpvTestCase):
def test_wait_for_property_concurrency(self):
players = [mpv.MPV(vo=testvo, loglevel='debug', log_handler=timed_print()) for i in range(2)]
-
try:
for _ in range(150):
for player in players:
- player.play('tests/test.webm')
+ player.loadfile('tests/test.webm', loop='inf')
for player in players:
player.wait_for_property('seekable')
for player in players: