相关疑难解决方法(0)

单元测试导致sys.exit()

无论我做什么,sys.exit()都由unittest调用,即使是最琐碎的例子.我无法判断我的安装是否搞砸了或者发生了什么.

IDLE 1.2.2      ==== No Subprocess ====
>>> import unittest
>>> 
>>> class Test(unittest.TestCase):
        def testA(self):
            a = 1
            self.assertEqual(a,1)

>>> unittest.main()
option -n not recognized
Usage: idle.pyw [options] [test] [...]

Options:
  -h, --help       Show this message
  -v, --verbose    Verbose output
  -q, --quiet      Minimal output

 Examples:
   idle.pyw                               - run default set of tests
   idle.pyw MyTestSuite                   - run suite 'MyTestSuite'
   idle.pyw MyTestCase.testSomething      - run MyTestCase.testSomething
   idle.pyw MyTestCase                    - run all 'test*' test methods
                                           in MyTestCase

Traceback (most recent call last):
  File …
Run Code Online (Sandbox Code Playgroud)

python unit-testing

18
推荐指数
5
解决办法
7171
查看次数

标签 统计

python ×1

unit-testing ×1