1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

[tests] implement skipping/failing tests when pressing ctrl+c

This commit is contained in:
Mike Fährmann 2023-11-24 00:43:07 +01:00
parent 4e15513415
commit 119755a5a3
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -405,7 +405,17 @@ def generate_tests():
def _generate_method(result):
def test(self):
print("\n" + result["#url"])
self._run_test(result)
try:
self._run_test(result)
except KeyboardInterrupt as exc:
v = input("\n[e]xit | [f]ail | [S]kip ? ").strip().lower()
if v in ("e", "exit"):
raise
if v in ("f", "fail"):
self.fail("manual test failure")
else:
self._skipped.append((result["#url"], exc))
self.skipTest(exc)
return test
# enable selective testing for direct calls