2017-04-27 50 views
0

我想尝试图形单元测试作为正式documents做图形单元测试时说:错误的Kivy应用

我有nose和安装coverage。我输入make test

但之后我得到一个错误:
make: *** No rule to make target 'test'. Stop.

如何解决这个问题,好吗?

回答

0

使得命令应该从源文件夹的根文件夹运行。

基本上它只做:

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. 
+0

嗨,感谢您的答案,似乎工作,但仍然以'0.000的测试0'结束,任何想法?我用你的'python -m nose.core my_test.py'方法。里面的代码来自kivy官方图形测试文档。我认为混淆的部分是没有断言,只是r(),这个渲染函数在这里声明了什么? –

+0

看来你在文件中没有任何测试......反正** r **(* render *)会创建一个图像文件,你可以保存这些文件并稍后使用它们进行比较 –

+0

谢谢,有点有点困惑,在调用r()之后发生了什么?只是渲染一张图片?我们需要通过我们的眼睛来检查它是对还是错?我跟着官方文档,似乎他们只叫r()...我希望在这里有一些比较方法。 –