V2 modules may have extras / optional dependencies.The project and remote_orchestrator fixtures currently do not support this: the module is rsynced to the server and installed in editable mode, but no extras can be supplied. A generic fix could be to provide a method on Project to add a dependency to requirements.txt.
For example, suppose the module mymodule has an extra named myextra, the conftest.py could define a fixture as follows:
Then, test cases that want to test the behavior when the extra is present would just have to use this project_with_extra fixture instead of the normal project fixture.
The connect module is an example of a module with an extra. At the time of writing it is being converted to a v2 module and an approach similar to the one described above is being implemented in the module's tests itself.
V2 modules may have extras / optional dependencies.The
project
andremote_orchestrator
fixtures currently do not support this: the module is rsynced to the server and installed in editable mode, but no extras can be supplied. A generic fix could be to provide a method onProject
to add a dependency torequirements.txt
.For example, suppose the module
mymodule
has an extra namedmyextra
, theconftest.py
could define a fixture as follows:Then, test cases that want to test the behavior when the extra is present would just have to use this
project_with_extra
fixture instead of the normalproject
fixture.The
connect
module is an example of a module with an extra. At the time of writing it is being converted to a v2 module and an approach similar to the one described above is being implemented in the module's tests itself.