我已经创建了一个包含以下代码的first.py文件。然后在命令提示符(或)中右键单击first.py并点击run按钮,将其作为python first.py运行。我看到了以下输出。
我期望test1()函数能够运行并通过。为什么我的测试没有运行?
输出:
C:\Python27\python.exe
C:/Users/sbulusu/PycharmProjects/BlackLineAutomation/main/python/ConnectAPI/first.py
Process finished with exit code 0first.py内容:
from proboscis import test
from proboscis import asserts
@test()
def test1():
asserts.assert_equal(1, 1)发布于 2016-03-03 18:16:22
您在函数first.py中的何处调用?添加编辑过的代码如下所示,它是有效的。添加了Test_Program代码。
from proboscis import test
from proboscis import asserts
from proboscis import TestProgram
@test()
def test1():
asserts.assert_equal(1, 1)
TestProgram().run_and_exit() 输出结果为:
C:\Python\python.exe first.py
proboscis.case.FunctionTest (test1) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
Process finished with exit code 0https://stackoverflow.com/questions/34517769
复制相似问题