tar -zvxf nose-1.3.7.tar.gz cd nose-1.3.7 python setup.py install |
import logging log = logging.getLogger(__name__) def test_learn_3(): print("test_lean_3") pass def test_lean_4(): print("test_learn_2") def test_lean_5(): print("test_learn_5") def setUp(): print("0002 test setUp") def tearDown(): print("0002 test teardown") test_learn_3.teardown = test_lean_5.teardown = tearDown |
class TestClass(): def setUp(self): print("MyTestClass setup") def tearDown(self): print("MyTestClass teardown") def Testfunc1(self): print("this is Testfunc1") pass def test_func1(self): print("this is test_func1") pass def Testfunc2(self): print("this is Testfunc2") pass def test_func2(self): print("this is test_func2") pass |
def setup_func(): "set up test fixtures" def teardown_func(): "tear down test fixtures" @with_setup(setup_func, teardown_func) def test(): "test ..." |
nosetests --with-html-output --html-out-file=result1.html |
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) | Powered by Discuz! X3.2 |