Add tests for require-virtualenv #12843
Labels
C: tests
Testing and related things
help wanted
For requesting inputs from other members of the community
project: virtualenv
Related to virtualenv
As far as I know, the require-virtualenv functionality is essentially entirely untested. This is the main reason why it is not documented (see also #2429).
It would be good to see tests for
--require-virtualenv
--require-virtualenv
featureBelow, I've attached some old discussion on this topic.
I started taking a look at the tests- as far as I can tell
require_venv
isn't actually tested anywhere and it's not clear to me that there would be any benefit to testing the behavior ofignore_require_venv
for this particular command.This is the only reference I can find (
tests/unit/test_options.py
) and it only seems to be asserting that the order (command, option) doesn't matter.my first thought is to implement something like:
running_under_virtualenv()
incli/base_command.py
(with return value of has_venv column in table below)assert_option_error(msg)
however... that test condition looks an awful lot like a reimplementation of the original implementation...
error condition truth matrix:
so I guess I'm a little lost on what a test for this should look like...
Originally posted by @justin-f-perez in #10658 (comment)
The text was updated successfully, but these errors were encountered: