GithubHelp home page GithubHelp logo

django-autotest's Introduction

django-autotest

Autotest automatically runs django tests when python files change.

  • It only runs the tests from the django app in which the file(s) changed
  • If you change a test_*.py file, only the tests in that file are run
  • If tests fail it keeps running only the failed tests on subsequent changes
$ autotest
Watching for changes to python files...


########################################################
Testing home.tests
########################################################
Creating test database for alias 'default'...
Found 1 test(s).
System check identified no issues (0 silenced).
F
======================================================================
FAIL: test_foo (home.tests.FooTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/alex/tmp/djangotest/mysite/home/tests.py", line 6, in test_foo
    self.assertFalse(True)
AssertionError: True is not false

----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (failures=1)
Destroying test database for alias 'default'...

# ๐Ÿ”ด 1 Tests failed!
# - FAIL: home.tests.FooTestCase
# 0 testcase(s) in queue.

Installation

  • Clone the repo
  • Install watchfiles with $ pip install --user watchfiles
  • Put autotest in a directory that's in your $PATH
    • For example on Linux you can link it in /usr/local/bin with ln -s /path/to/repo/autotest /usr/local/bin/autotest

Usage

In your Django root directory run: $ autotest.

$ autotest --help
usage: autotest [-h] [-k PATTERN]

Automatically run Django tests when files change.

options:
  -h, --help  show this help message and exit
  -k PATTERN  Only run test methods and classes that match the pattern. Passed to Django.

django-autotest's People

Contributors

acidtv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.