mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-03 15:38:12 +08:00
Document how to run tests on your computer
This commit is contained in:
+34
-1
@@ -186,7 +186,40 @@ For more info check the `Schedules <https://django-q.readthedocs.org/en/latest/s
|
||||
Testing
|
||||
~~~~~~~
|
||||
|
||||
To run the tests you will need `py.test <http://pytest.org/latest/>`__ and `pytest-django <https://github.com/pytest-dev/pytest-django>`__
|
||||
To run the tests you will need the following in addition to install requirements:
|
||||
|
||||
* `py.test <http://pytest.org/latest/>`__
|
||||
* `pytest-django <https://github.com/pytest-dev/pytest-django>`__
|
||||
* disque from https://github.com/antirez/disque.git
|
||||
* Redis
|
||||
* MongoDB
|
||||
|
||||
The following commands can be used to run the tests:
|
||||
|
||||
```
|
||||
# Create virtual environment
|
||||
python -m venv venv
|
||||
|
||||
# Install requirements
|
||||
venv/bin/pip install -r requirements.txt
|
||||
|
||||
# Install test dependencies
|
||||
venv/bin/pip install pytest pytest-django
|
||||
|
||||
# Install django-q
|
||||
venv/bin/python setup.py develop
|
||||
|
||||
|
||||
# Run required services (you need to have docker-compose installed)
|
||||
docker-compose -f test-services-docker-compose.yaml up -d
|
||||
|
||||
# Run tests
|
||||
venv/bin/pytest
|
||||
|
||||
# Stop the services required by tests (when you no longer plan to run tests)
|
||||
docker-compose -f test-services-docker-compose.yaml down
|
||||
|
||||
```
|
||||
|
||||
|
||||
Locale
|
||||
|
||||
Reference in New Issue
Block a user