-
-
Notifications
You must be signed in to change notification settings - Fork 409
isup: fix double output, and add tests #2063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Regression introduced in 5af0eea.
Co-Authored-By: Exirel <[email protected]>
Exirel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to use else:
try:
# do something
except:
# bot.reply error
except:
# bot.reply a different error
else:
# bot.say all is fine|
@Exirel Yeah, per our IRC chatter I did that locally. Haven't pushed yet; sparing Travis until I finish writing the test suite. |
d8c072b to
536360f
Compare
Made simpler thanks to the recent addition of `requests-mock` to Sopel's dev-requirements.txt file. This replaces an older (late 2020) branch that I never finished and PR'd.
536360f to
eb60900
Compare
Exirel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to refactor mocks to reduce the duplicate code in tests? Yes, for sure. Is it necessary to approve that PR? No, it's fine like it is.
Well done on your testing journey, I hope it was enjoyable. As discussed, some tweaks are required in the future to make it even easier, and I probably need to write some more doc about it.
For now, this is a go!
The previous `time.sleep()` approach was suggested on IRC, and I just ran with it because at the time, it was past 2am. With a fresh mind, though, and a look at the docstrings for both `bot.running_triggers` and `bot._update_running_triggers()`, I have realized the true utility of this property.
|
@Exirel Reimplemented fixtures, along with a much more interesting use of Lines 959 to 962 in 559987d
Early in the process, before figuring out that threading was the problem, I wrongly theorized that some multiple-instance voodoo might be messing up which |
|
Even better now! |
Description
Fixes #2061, a regression introduced in 5af0eea.
Checklist
make qa(runsmake qualityandmake test)