Skip to content
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

Consider switching to tox.ini to run tests #85

Open
cthoyt opened this issue Apr 19, 2022 · 2 comments
Open

Consider switching to tox.ini to run tests #85

cthoyt opened this issue Apr 19, 2022 · 2 comments

Comments

@cthoyt
Copy link

cthoyt commented Apr 19, 2022

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 a tox.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

@hechth
Copy link
Member

hechth commented Apr 19, 2022

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.

@hechth
Copy link
Member

hechth commented Apr 21, 2022

@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.

@hechth hechth changed the title How to run tests locally? Consider switching to tox.ini to run tests Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants