Repository navigation
Unregister listeners on Output.close - #1993
Conversation
|
Admin, can CI be enabled? |
There was a problem hiding this comment.
Do I get it right that the verified "[from listener 1]" was already created by the first run and here it is tested that the second run didn't produce new output? I think it would be better to add a method like RunningTestCase._clear_outputs that could be called before the second run and then verified that outputs are empty after the second run. Same could then me done also with test_listeners in test_run_and_rebot.py.
|
I looked at the PR and the related code and have two general comments:
Looking at the code, it seems Could you verify my analysis by adding |
|
Yes, you are right. After my change |
|
Yes, I'm still thinking how to do that right. Maybe you have some idea? |
There was a problem hiding this comment.
Is there a reason to have _registered_logger as a class attribute? Is there a need to share a list of loggers? If not, this definitely should be an instance attribute.
|
There seems to be two easy solutions how to close loggers:
|
|
Thank you. I have decided to use first way. Seems to be best way for now. I also did other changes you have requested. I have one extra question: |
|
Using |
There was a problem hiding this comment.
It would perhaps be a little more clear to format the above like this:
for logger in self._registered_loggers:
logger.close()
LOGGER.unregister_logger(logger)|
This PR looks very good. For consistency reasons new After you are done, please squash the commits and I'll merge this. If you can do it during Tuesday, we'll still get it to 2.9a2. |
|
@WojtekKowaluk, do you think you get this PR finalised today? We try to create 2.9a2 on Wednesday and are now descoping issues we cannot get into it. This is pretty much ready and we'd like to get it closed. |
|
I am working on it right now. I will do my best to finish it today. |
|
@pekkaklarck Are you sure you want this method to be named |
|
@pekkaklarck @jussimalinen commits are squashed now, let me know if anything else should be done. |
There was a problem hiding this comment.
Is run needed here instead of run_without_outputs that's used by above tests?
|
Yeah, definitely In the final review I noticed that calling listeners' close method doesn't seem to be tested. Can you still take a look at that and the other two line notes? Sorry about not noticing these earlier. |
|
Fixed. |
There was a problem hiding this comment.
Should also reset self._registered_loggers. I can add that.
Unregister listeners in `Output.close`. This makes sure listeners are unregistered when using `TestSuite.run` API.
Fix for #1992