From d12aa83673009d3ac82a137cead8a5efd56f4241 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Wed, 18 May 2022 07:01:39 -0500 Subject: [PATCH] Document how to run the unit tests locally When verifying the steps on Windows, the `.eggs` directory suddenly appeared. This is now ignored. --- .gitignore | 1 + CONTRIBUTING.md | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.gitignore b/.gitignore index 993327a..c904d91 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.egg-info *.pyc .coverage* +.eggs/ .idea/ .tox/ .venv/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a56d1c4..53c18ec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,6 +50,31 @@ used in the rest of the project. The version history should be clean, and commit messages should be descriptive and [properly formatted][commit-messages]. +When preparing a patch, it's recommended that you add unit tests +that demonstrate the bug is fixed (or that the feature works). +You can run the tests on your local machine by installing the `dev` extras. +The steps below do this using a virtual environment: + +```shell +# Create a local virtual environment +$ python -m venv .venv + +# Activate the virtual environment +# Cygwin, Linux, and MacOS: +$ . .venv/bin/activate +# Windows Powershell: +$ & .venv\Scripts\Activate.ps1 + +# Update pip and setuptools +(.venv) $ python -m pip install -U pip setuptools + +# Install dotbot and its development dependencies +(.venv) $ python -m pip install -e .[dev] + +# Run the unit tests +(.venv) $ tox +``` + --- If you have any questions about anything, feel free to [ask][email]!