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:
parent
4e15513415
commit
119755a5a3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user