spinn_utilities.testing package¶
Submodules¶
spinn_utilities.testing.log_checker module¶
- spinn_utilities.testing.log_checker.assert_logs_contains_once(level: str, log_records: List[LogRecord], message: str) None [source]¶
Checks if the log records contain exactly one record at the given level with the given sub-message.
Note
While this code does not depend on testfixtures, you will need testfixtures to generate the input data
- Parameters:
level – The log level. Probably “INFO”, “WARNING” or “ERROR”.
log_records – list of log records returned by testfixtures.LogCapture
submessage – String which should be part of a log record
- Raises:
AssertionError – If the submessage is not present in the log
- spinn_utilities.testing.log_checker.assert_logs_error_contains(log_records: List[LogRecord], submessage: str) None [source]¶
Checks it the log records contain an ERROR log with this sub-message
Note
While this code does not depend on testfixtures, you will need testfixtures to generate the input data
- Parameters:
log_records – list of log records returned by testfixtures.LogCapture
submessage – String which should be part of an ERROR log
- Raises:
AssertionError – If the submessage is not present in the log
- spinn_utilities.testing.log_checker.assert_logs_error_not_contains(log_records: List[LogRecord], submessage: str) None [source]¶
Checks it the log records do not contain an ERROR log with this sub-message.
Note
While this code does not depend on testfixtures, you will need testfixtures to generate the input data
- Parameters:
log_records – list of log records returned by testfixtures.LogCapture
submessage – String which should be part of an ERROR log
- Raises:
AssertionError – If the submessage is present in the log
- spinn_utilities.testing.log_checker.assert_logs_info_contains(log_records: List[LogRecord], sub_message: str) None [source]¶
Checks it the log records contain an INFO log with this sub-message
Note
While this code does not depend on testfixtures, you will need testfixtures to generate the input data
- Parameters:
log_records – list of log records returned by testfixtures.LogCapture
sub_message – String which should be part of an INFO log
- Raises:
AssertionError – If the submessage is not present in the log
- spinn_utilities.testing.log_checker.assert_logs_info_not_contains(log_records: List[LogRecord], submessage: str) None [source]¶
Checks it the log records do not contain an INFO log with this sub-message.
Note
While this code does not depend on testfixtures, you will need testfixtures to generate the input data
- Parameters:
log_records – list of log records returned by testfixtures.LogCapture
submessage – String which should be part of an INFO log
- Raises:
AssertionError – If the submessage is present in the log
- spinn_utilities.testing.log_checker.assert_logs_warning_contains(log_records: List[LogRecord], submessage: str) None [source]¶
Checks it the log records contain an WARNING log with this sub-message
Note
While this code does not depend on testfixtures, you will need testfixtures to generate the input data
- Parameters:
log_records – list of log records returned by testfixtures.LogCapture
submessage – String which should be part of an WARNING log
- Raises:
AssertionError – If the submessage is not present in the log