Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pycharm/_jb_unittest_runner 模式不支持 #1

Closed
stcnchenxin opened this issue Apr 23, 2018 · 5 comments
Closed

pycharm/_jb_unittest_runner 模式不支持 #1

stcnchenxin opened this issue Apr 23, 2018 · 5 comments

Comments

@stcnchenxin
Copy link

stcnchenxin commented Apr 23, 2018

Launching unittests with arguments python -m unittest Q6TestCase.Q6TestCase in G:\AutoTest\Q6-Airtest\my-testflow\Q6\lib\Q6TestCase

Traceback (most recent call last):
  File "D:\PyCharm Community Edition 2017.3.5\helpers\pydev\pydevd.py", line 1668, in <module>
    main()
  File "D:\PyCharm Community Edition 2017.3.5\helpers\pydev\pydevd.py", line 1662, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "D:\PyCharm Community Edition 2017.3.5\helpers\pydev\pydevd.py", line 1072, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "D:\PyCharm Community Edition 2017.3.5\helpers\pycharm\_jb_unittest_runner.py", line 35, in <module>
    main(argv=args, module=None, testRunner=unittestpy.TeamcityTestRunner, buffer=not JB_DISABLE_BUFFERING)
  File "D:\Python27\Lib\unittest\main.py", line 94, in __init__
    self.parseArgs(argv)
  File "D:\Python27\Lib\unittest\main.py", line 149, in parseArgs
    self.createTests()
  File "D:\Python27\Lib\unittest\main.py", line 158, in createTests
    self.module)
  File "D:\Python27\Lib\unittest\loader.py", line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "D:\Python27\Lib\unittest\loader.py", line 105, in loadTestsFromName
    return self.loadTestsFromTestCase(obj)
  File "D:\Python27\Lib\unittest\loader.py", line 56, in loadTestsFromTestCase
    loaded_suite = self.suiteClass(map(testCaseClass, testCaseNames))
TypeError: __init__() takes exactly 1 argument (2 given)

照着代码复制了一遍,也按照了pocounit库,但是debug的时候出现了这个报错,请问下这个是啥问题?

from pocounit.case import PocoTestCase
from pocounit.addons.poco.action_tracking import ActionTracker
from poco.drivers.unity3d import UnityPoco

class GxxTestCase(PocoTestCase):
    @classmethod
    def setUpClass(cls):
        super(GxxTestCase, cls).setUpClass()
        cls.poco = UnityPoco(('<ip>', 5001))

        # 启用动作捕捉(action tracker)
        action_tracker = ActionTracker(cls.poco)
        cls.register_addon(action_tracker)
@adolli
Copy link
Member

adolli commented Apr 23, 2018

使用pycharm运行时,不要用默认的_jb_unittest_runner,直接用python xxx.py的方式即可。
image

@stcnchenxin
Copy link
Author

请问下这个在哪里修改?没找着选项……

@adolli adolli changed the title 请问下这个报错是什么情况? pycharm/_jb_unittest_runner 模式不支持 Apr 23, 2018
@adolli
Copy link
Member

adolli commented Apr 23, 2018

image
Run -> Edit Configurations... 可弹出上面的界面。

@stcnchenxin
Copy link
Author

可以了,多谢~

@adolli adolli closed this as completed Apr 23, 2018
@adolli
Copy link
Member

adolli commented Apr 23, 2018

不用客气。PocoUnit是负责单元测试模型的,用例管理和用例集成工程化方案可以参考 my-testflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants