Skip to content

Commit

Permalink
reporters: test report jobs separately
Browse files Browse the repository at this point in the history
This PR should make the `--test-reporter` option respect `separate` flag too..
It's just applying the changes already made with #721 from `submit_all` method to the `submit_one` method as well.

fixes #771

I hope this is ok so far, because my python is not the best 😉
  • Loading branch information
marunjar committed Oct 24, 2023
1 parent 8a3f4b3 commit 6c0d85c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/urlwatch/reporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ def submit_one(cls, name, report, job_states, duration):
subclass = cls.__subclasses__[name]
cfg = report.config['report'].get(name, {'enabled': False})
if cfg['enabled']:
subclass(report, cfg, job_states, duration).submit()
base_config = subclass.get_base_config(report)
if base_config.get('separate', False):
for job_state in job_states:
subclass(report, cfg, [job_state], duration).submit()
else:
subclass(report, cfg, job_states, duration).submit()
else:
raise ValueError('Reporter not enabled: {name}'.format(name=name))

Expand Down

0 comments on commit 6c0d85c

Please sign in to comment.