Code quality issues with kivy upload

This commit is contained in:
Peter Šurda 2022-08-10 07:54:27 +08:00
parent e5e9955cd9
commit 8214c74487
Signed by: PeterSurda
GPG Key ID: 3E47497CF67ABB95

View File

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