我想尝试图形单元测试,正如官方documents所说:
我安装了nose
和coverage
。
但在我输入make test
后
我收到一个错误:
make: *** No rule to make target 'test'. Stop.
请问如何解决这个问题?
答案 0 :(得分:0)
make 命令应该从 kivy 源文件夹的根文件夹运行。
基本上只有:
test:
-rm -rf kivy/tests/build
$(NOSETESTS) kivy/tests
您也可以使用此命令而无需通过Makefile :
python -m nose.core your_project/your_tests
关于渲染功能(r),我将在这里复制部分文档:
Each call to self.render (or r in our example) will generate an image named as follows:
<classname>_<funcname>-<r-call-count>.png
r-call-count represents the number of times that self.render is called inside the test function.
The reference images are named:
ref_<classname>_<funcname>-<r-call-count>.png
You can easily replace the reference image with a new one if you wish.