tools/compile_test_one_board: rename TestError exception class

Otherwise it conflicts with pytest automatic parsing which tries to execute all classes with name beginning with Test
This commit is contained in:
Alexandre Abadie 2019-01-22 08:44:28 +01:00
parent 1f7292c358
commit 26a64694dd
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -79,7 +79,7 @@ LOG_HANDLER.setFormatter(logging.Formatter(logging.BASIC_FORMAT))
LOG_LEVELS = ('debug', 'info', 'warning', 'error', 'fatal', 'critical') LOG_LEVELS = ('debug', 'info', 'warning', 'error', 'fatal', 'critical')
class TestError(Exception): class ErrorInTest(Exception):
"""Custom exception for a failed test. """Custom exception for a failed test.
It contains the step that failed in 'message', the 'application' and the It contains the step that failed in 'message', the 'application' and the
@ -264,7 +264,7 @@ class RIOTApplication():
try: try:
self.compilation_and_test(**test_kwargs) self.compilation_and_test(**test_kwargs)
return None return None
except TestError as err: except ErrorInTest as err:
self.logger.error('Failed during: %s', err) self.logger.error('Failed during: %s', err)
return (str(err), err.application.appdir, err.errorfile) return (str(err), err.application.appdir, err.errorfile)
@ -283,7 +283,7 @@ class RIOTApplication():
succeeds. succeeds.
:param incremental: Do not rerun successful compilation and tests :param incremental: Do not rerun successful compilation and tests
:raises TestError: on execution failed during one step :raises ErrorInTest: on execution failed during one step
""" """
# Ignore incompatible APPS # Ignore incompatible APPS
@ -301,7 +301,7 @@ class RIOTApplication():
create_directory(self.resultdir, clean=not incremental) create_directory(self.resultdir, clean=not incremental)
# Run compilation and flash+test # Run compilation and flash+test
# It raises TestError on error which is handled outside # It raises ErrorInTest on error which is handled outside
compilation_cmd = list(self.COMPILE_TARGETS) compilation_cmd = list(self.COMPILE_TARGETS)
if jobs is not None: if jobs is not None:
@ -415,7 +415,7 @@ class RIOTApplication():
self.logger.warning(output) self.logger.warning(output)
self.logger.error('Error during %s, writing to %s', name, outfile) self.logger.error('Error during %s, writing to %s', name, outfile)
raise TestError(name, self, outfile) raise ErrorInTest(name, self, outfile)
def _write_resultfile(self, name, status, body=''): def _write_resultfile(self, name, status, body=''):
"""Write `body` to result file `name.status`. """Write `body` to result file `name.status`.