Django REST Framework Toolkit (DRFT)
pip install drft
It's recommended that you use pyenv
, which you can read about more here.
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
This project uses poetry, which you can read more about here. Install it using the following command.
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
More instructions here
poetry install
Install pre-commit hooks:
poetry run pre-commit install --hook-type commit-msg
poetry run pre-commit install
For running tests this project uses both pytest and tox.
tox
All tests are housed in the tests package. Two markers are made available to explicitly distinguish between unit and integration tests.
# in test_some_util.py
import pytest
@pytest.mark.unit
class TestSomeUtil:
def test_basic_signature(self):
...
@pytest.mark.integration
class TestSomeUtilInApp:
def test_app_workflow(self):
...
More information on pytest's markers can be found here.
To run just the unit tests:
pytest -m unit
To run everything but the unit tests:
pytest -m "not unit"