summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElias Müller <elias.mr1@gmail.com>2022-07-09 19:19:34 +0200
committerjaseg <136313+jaseg@users.noreply.github.com>2022-07-11 12:44:47 +0200
commitb12203d2d2cfcd7f7868eb8e5bde1c7fa48e12b7 (patch)
treeaf412efbec251ebcc98065f6af02647fa144c5d2
parentfcd2c354ae879b3351a244dde87426fd38558640 (diff)
downloadpython-mpv-b12203d2d2cfcd7f7868eb8e5bde1c7fa48e12b7.tar.gz
python-mpv-b12203d2d2cfcd7f7868eb8e5bde1c7fa48e12b7.tar.bz2
python-mpv-b12203d2d2cfcd7f7868eb8e5bde1c7fa48e12b7.zip
Skip unreliable test in CI
-rw-r--r--.github/workflows/tests.yml2
-rwxr-xr-xtests/test_mpv.py38
2 files changed, 22 insertions, 18 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 5dfcb58..e262bba 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -20,6 +20,8 @@ jobs:
name: 'Python'
env:
DISPLAY: :0
+ PY_MPV_SKIP_TESTS: >-
+ test_wait_for_property_event_overflow
steps:
- uses: actions/checkout@v2
- name: 'Install Python'
diff --git a/tests/test_mpv.py b/tests/test_mpv.py
index 9a2a9a7..c2702b5 100755
--- a/tests/test_mpv.py
+++ b/tests/test_mpv.py
@@ -42,6 +42,7 @@ else:
TESTVID = os.path.join(os.path.dirname(__file__), 'test.webm')
TESTSRT = os.path.join(os.path.dirname(__file__), 'sub_test.srt')
MPV_ERRORS = [ l(ec) for ec, l in mpv.ErrorCode.EXCEPTION_DICT.items() if l ]
+SKIP_TESTS = os.environ.get('PY_MPV_SKIP_TESTS', '').split()
def timed_print():
@@ -656,24 +657,25 @@ class TestLifecycle(unittest.TestCase):
m.terminate()
self.disp.stop()
- # def test_wait_for_property_event_overflow(self):
- # self.disp = Xvfb()
- # self.disp.start()
- # m = mpv.MPV(vo=testvo)
- # m.play(TESTVID)
- # with self.assertRaises(mpv.EventOverflowError):
- # # level_sensitive=false needed to prevent get_property on dead
- # # handle
- # with m.prepare_and_wait_for_property('mute', cond=lambda val: time.sleep(0.001)):
- # for i in range(10000):
- # try:
- # # We really have to try hard to fill up the queue here. Simple async commands will not work,
- # # since then command_async will throw a memory error first. Property changes also do not work,
- # # since they are only processsed when the event loop is idle. This here works reliably.
- # m.command_async('script-message', 'foo', 'bar')
- # except:
- # pass
- # self.disp.stop()
+ @unittest.skipIf('test_wait_for_property_event_overflow' in SKIP_TESTS, reason="kills X-Server first")
+ def test_wait_for_property_event_overflow(self):
+ self.disp = Xvfb()
+ self.disp.start()
+ m = mpv.MPV(vo=testvo)
+ m.play(TESTVID)
+ with self.assertRaises(mpv.EventOverflowError):
+ # level_sensitive=false needed to prevent get_property on dead
+ # handle
+ with m.prepare_and_wait_for_property('mute', cond=lambda val: time.sleep(0.001)):
+ for i in range(10000):
+ try:
+ # We really have to try hard to fill up the queue here. Simple async commands will not work,
+ # since then command_async will throw a memory error first. Property changes also do not work,
+ # since they are only processsed when the event loop is idle. This here works reliably.
+ m.command_async('script-message', 'foo', 'bar')
+ except:
+ pass
+ self.disp.stop()
def test_wait_for_event_shutdown(self):
self.disp = Xvfb()