On a python distribution (Plone related) that I'm developing I added an extra requirement: async
Thus, if someone wants to use it without async features that's fine, but they have also that possibility. Code has already been updated to use it conditionally.
But now the question is: on my test runner I declare my own distribution to install the async extra so I can test the async functionality, but that prevents me from testing the non-async code paths.
How can one handle this?
I see two possibilities:
build two test runners with different dependencies installed.
if this is not acceptable, you could condition the imports of your optional dependency not only on the availability of the package but also on the value of a global variable. Your test runner could run tests twice with the variable configured on and off.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With