Open cthoyt opened 2 years ago
Unit tests can be run from command line from using pytest . if all dependencies are installed. The CI merely installs the dependencies.
The tox.ini also creates an environment it seems so it kind of replicates the conda environment.
@cthoyt Are you able to install the conda environment via conda create -f conda\environment-dev.yml
?
Otherwise, you can install the requirements using the requirements.txt
file and then run the tests using pytest .
in the root folder of the repository.
I was reading through the CI configuration and it seems like a lot of complicated steps are required to run the tests. I'd suggest using something like
tox
to create atox.ini
file that simplifies the installation of the code and running of the tests and various other tasks like flake8, linting, etc.Here's an example from one of my projects https://github.com/cthoyt/pystow/blob/main/tox.ini that lets you run
tox -e py
to run the unit tests from the command line and it takes care of making a virtual env and installing the right dependencies