How to automatically run tests when there's any change in my project (Django)?

后端 未结 14 1932
有刺的猬
有刺的猬 2020-12-23 19:45

At the moment I am running python manage.py test every once in a while after I make significant changes in my django project. Is it possible to run those tests

14条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-23 20:08

    Another Javascript dev here, I've found nodemon (https://github.com/remy/nodemon) to work pretty well. By default it watches *.js files but that's configurable with the --ext flag. To use it, do:

    npm install -g nodemon
    cd /your/project/dir/
    nodemon --ext py --exec "python manage.py test"
    

    Now, whenever a *.py file changes, it'll re-run your command. It even finds new files.

提交回复
热议问题