Commit fb37215f authored by Grant Paton-Simpson's avatar Grant Paton-Simpson

Use system as source not advisor if an error.

* Crucial to ensure tests only count messages when they actually run
without an error
parent 1fabbae0
Pipeline #557 failed with stages
......@@ -184,12 +184,14 @@ def get_message_dets_from_input(advisor_dets, *,
source = conf.SYSTEM_MESSAGE
warning = True
source = name
warning = advisor_dets.warning
if message is None:
return None
message = complete_message(message, source=advisor_dets.advisor_name)
message = complete_message(message, source=source)
message_dets = MessageDets(
code_str, message, first_line_no, warning, source=name)
return message_dets
......@@ -13,6 +13,10 @@ def get_actual_source_freqs(messages_dets, expected_source_freqs):
those that we require (and how often) and those we ban (we expect those 0
Note - exclude system-generated messages e.g. a message fails to run so we
get a message all right but it is a message reporting the problem. Don't
count those ;-).
:param list messages_dets: list of MessageDets named tuples
:param dict expected_source_freqs: keys are sources (strings) and values are
integers. The integer should be set to 0 if we want to explicitly ban a
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment