PegasusWang / python_data_structures_and_algorithms

Python 中文数据结构和算法教程

Home Page:http://pegasuswang.github.io/python_data_structures_and_algorithms/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

单测问题

Qingqing1spider opened this issue · comments

老师您好,我看您的课程中我发现您每次写完单测函数之后不执行那个函数,是因为您的那个测试工具就会自动执行里面的函数吗?

hi, readme 里有说明哈。使用的是 whenchanged 监控文件变动之后自动执行 pytest。你可以安装 when-changed 和 `pip install pytest' 之后,在你的 .bashrc 或者.zshrc 加入这个函数:

# pip install when-changed
function pytest_monitor_run() {
  when-changed -r -v -1 "$1" pytest -s "$1"
}

然后就可以使用 pytest_monitor_run 加上你的测试文件执行了