LiveStock & Grazing
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fabfile.py 695B

123456789101112131415161718192021222324252627282930
  1. import os
  2. import shutil
  3. from fabric.operations import local
  4. COVERAGE_REPORT_HTML_DIR = 'coverage_html'
  5. COVERAGE_REPORT_FILE = '.coverage'
  6. def cq() -> None:
  7. """Run Code quality chcker."""
  8. local('flake8 --config=flake8.ini')
  9. def test() -> None:
  10. """Run all tests."""
  11. local('python manage.py test')
  12. def coverage() -> None:
  13. """Runs tests with coverage report."""
  14. if os.path.exists(COVERAGE_REPORT_HTML_DIR):
  15. shutil.rmtree(COVERAGE_REPORT_HTML_DIR)
  16. if os.path.isfile(COVERAGE_REPORT_FILE):
  17. os.remove(COVERAGE_REPORT_FILE)
  18. local("coverage run --source='.' manage.py test")
  19. local("coverage report --skip-covered")
  20. local("coverage html")