File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -411,6 +411,18 @@ <h2 id="_17">工具</h2>
411
411
pip install when-changed
412
412
</ code > </ pre >
413
413
414
+ < p > 视频演示里我使用到了一个简单的 test.sh 脚本文件,内容如下:</ p >
415
+ < pre > < code class ="sh "> #!/usr/bin/env bash
416
+
417
+ # pip install when-changed
418
+ when-changed -v -r -1 -s ./ "py.test -s $1"
419
+ </ code > </ pre >
420
+
421
+ < p > 将以上内容放到 test.sh 文件后加上可执行权限, < code > chmod +x test.sh</ code > ,之后就可以用</ p >
422
+ < pre > < code > './test.sh somefile.py'
423
+ </ code > </ pre >
424
+
425
+ < p > 每次我们改动了代码,就会自动执行代码里的单元测试了。pytest 会自动发现以 test 开头的函数并执行测试代码。</ p >
414
426
< h2 id ="_18 "> 勘误</ h2 >
415
427
< p > 输出其实也是一种再学习的过程,中途需要查看大量资料、编写讲义、视频录制、代码编写等,难免有疏漏甚至错误之处。
416
428
有出版社找过笔者想让我出书,一来自己对出书兴趣不大,另外感觉书籍相对视频不够直观,有错误也不能及时修改,打算直接把所有
@@ -489,5 +501,5 @@ <h2 id="_19">本电子书制作和写作方式</h2>
489
501
490
502
<!--
491
503
MkDocs version : 0.17.3
492
- Build Date UTC : 2018-06-10 12:00:51
504
+ Build Date UTC : 2018-06-10 12:28:12
493
505
-->
You can’t perform that action at this time.
0 commit comments