Running single test from unittest.TestCase via command line

前端 未结 7 1629
甜味超标
甜味超标 2020-11-28 01:14

In our team, we define most test cases like this:

One \"framework\" class ourtcfw.py:

import unittest

class OurTcFw(unittest.TestCase):         


        
7条回答
  •  心在旅途
    2020-11-28 01:50

    Maybe, it will be helpful for somebody. In case you want to run only tests from specific class:

    if __name__ == "__main__":
        unittest.main(MyCase())
    

    It works for me in python 3.6

提交回复
热议问题