gpt4 book ai didi

unit-testing - Flask:重新加载时运行测试

转载 作者:行者123 更新时间:2023-12-03 17:34:54 24 4
gpt4 key购买 nike

我正在开发一个 flask 应用程序,我喜欢在检测到更改时重新加载代码的调试功能。上周我与 Karma/Jasmine 合作,看到它在检测到代码更改时运行测试。

是否有一种相对简单的方法可以使用 Flask 获得相同的行为,以便在代码更改时运行我的单元测试?

最佳答案

一种选择是使用 Nose带有 nose-watch 的测试运行器插入:

A Nose plugin that allows to run tests continuously (uses watchdog for listening to filesystem events).



另一种选择是使用 autonose :

Autonose is an autotest-like tool for python, using the excellent nosetest library.

...

Re-run tests instantly when you save a file



另见:
  • Is there something like 'autotest' for Python unittests?

  • 希望有帮助。

    关于unit-testing - Flask:重新加载时运行测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22278607/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com