Tests and Linting
This page describes tests and linting of the API (python) and how you can run tests locally as well as how the GitHub actions tests your code.
GitHub actions (CI/CD)
Running tests and linting locally
pip install flake8-import-order
pip install flake8-blind-except
pip install flake8-builtins
pip install flake8-docstrings
pip install flake8-rst-docstrings
pip install flake8-logging-formattox
pytest# Go to the helpers repo and install requirements.txt
alias farm-lint="flake8 . --ignore=D210,D100,D104,D401,D202,E202,E201,I201 --show-source --enable-extension=G --max-line-length=140 --max-complexity=7 --count"
alias farm-test="pytest -v -s" # This one is optional
farm-lint # will now run flake8 linting with the correct settings
farm-test # will now run pytest tests with two nice verbosity flags.tox
pytestCyclomatic Complexity References
Last updated