简体   繁体   中英

Working example of running a test using proboscis

I have created a first.py file with the following code in it. And then ran it as python first.py from command prompt (or) from Pycharm by right clicking on first.py and hitting run button. And i see the following output.

I expected the test1() function to run and pass. Why is my test not running?

Output:

C:\Python27\python.exe
C:/Users/sbulusu/PycharmProjects/BlackLineAutomation/main/python/ConnectAPI/first.py

Process finished with exit code 0

first.py Contents:

from proboscis import test

from proboscis import asserts

@test()
def test1():
    asserts.assert_equal(1, 1)

Where are you calling in your function first.py ? Add edited code is below, which works. Have added Test_Program code.

from proboscis import test
from proboscis import asserts
from proboscis import TestProgram

@test()
def test1():
    asserts.assert_equal(1, 1)

TestProgram().run_and_exit()  

And the output is :

C:\Python\python.exe first.py  
proboscis.case.FunctionTest (test1) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.000s

OK

Process finished with exit code 0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM