diff --git a/tests-kivy.py b/tests-kivy.py index a2d2130d..f4e21e8c 100644 --- a/tests-kivy.py +++ b/tests-kivy.py @@ -1,11 +1,11 @@ #!/usr/bin/env python """Custom tests runner script for tox and python3""" +import os import random # noseq +import subprocess import sys import unittest -from os import environ, mkdir -from subprocess import Popen, TimeoutExpired from time import sleep @@ -22,22 +22,22 @@ if __name__ == "__main__": if in_docker: try: - mkdir("../out") - except FileExistsError: # flake8: noqa:F821 + os.mkdir("../out") + except FileExistsError: # noqa:F821 pass - ffmpeg = Popen([ # pylint: disable=consider-using-with - "ffmpeg", "-y", "-nostdin", "-f", "x11grab", "-video_size", "vga", - "-draw_mouse", "0", "-i", environ['DISPLAY'], - "-codec:v", "libvpx-vp9", "-lossless", "1", "-r", "30", - "../out/test.webm" - ]) + ffmpeg = subprocess.Popen([ # pylint: disable=consider-using-with + "ffmpeg", "-y", "-nostdin", "-f", "x11grab", "-video_size", "vga", + "-draw_mouse", "0", "-i", os.environ['DISPLAY'], + "-codec:v", "libvpx-vp9", "-lossless", "1", "-r", "60", + "../out/test.webm" + ]) sleep(2) # let ffmpeg start result = unittest.TextTestRunner(verbosity=2).run(unittest_discover()) if in_docker: ffmpeg.terminate() try: ffmpeg.wait(10) - except TimeoutExpired: + except subprocess.TimeoutExpired: ffmpeg.kill() sys.exit(not result.wasSuccessful())