mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-19 19:28:22 +00:00
improve api tests and error output
show only relevant aptly logs if a test fails. for async tasks, show task output, as it contains the error message.
This commit is contained in:
@@ -128,6 +128,7 @@ class BaseTest(object):
|
||||
requiresGPG2 = False
|
||||
requiresDot = False
|
||||
sortOutput = False
|
||||
debugOutput = False
|
||||
|
||||
aptlyDir = ".aptly"
|
||||
aptlyConfigFile = ".aptly.conf"
|
||||
@@ -177,6 +178,10 @@ class BaseTest(object):
|
||||
try:
|
||||
self.run()
|
||||
self.check()
|
||||
except Exception as exc:
|
||||
if self.debugOutput:
|
||||
print(f"API log:\n{self.debug_output()}")
|
||||
raise exc
|
||||
finally:
|
||||
self.teardown()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user