参数化错误

来源:4-2 原生测试框架参数化的第一种方法

qq_Brilliantsun_0

2021-04-27

在参数化的时候,报的这个错误是怎么回事?

Testing started at 23:58 ...
Launching unittests with arguments python -m unittest po_unittest_1.MyTestCase in E:\封装页面基类-方法一\page

Traceback (most recent call last):
  File "D:\Development\PyCharm 2021.1\plugins\python\helpers\pycharm\_jb_unittest_runner.py", line 35, in <module>
    sys.exit(main(argv=args, module=None, testRunner=unittestpy.TeamcityTestRunner, buffer=not JB_DISABLE_BUFFERING))
  File "D:\Development\Python\lib\unittest\main.py", line 100, in __init__
    self.parseArgs(argv)
  File "D:\Development\Python\lib\unittest\main.py", line 147, in parseArgs
    self.createTests()
  File "D:\Development\Python\lib\unittest\main.py", line 158, in createTests
    self.test = self.testLoader.loadTestsFromNames(self.testNames,
  File "D:\Development\Python\lib\unittest\loader.py", line 220, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "D:\Development\Python\lib\unittest\loader.py", line 220, in <listcomp>
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "D:\Development\Python\lib\unittest\loader.py", line 214, in loadTestsFromName
    raise TypeError("don't know how to make test from: %s" % obj)
TypeError: don't know how to make test from: None

Process finished with exit code 1

Empty suite

图片描述

写回答

1回答

托尼老师

2021-04-27

错误显示的是加载测试模块和测试对象时出现了异常。

将项目路径

E:\封装页面基类-方法一\page

中的破折号改为下划线,重新运行,

如果仍然报相同的错,将中文路径改为英文,破折号改为下划线,再重新运行。

0
2
托尼老师
回复
qq_Brilliantsun_0
O(∩_∩)O
2021-05-06
共2条回复

Python自动化测试开发实战,能帮你就业的测试课

开发高扩展、高可用的自动化测试框架,利用好测试自动化技术。

445 学习 · 157 问题

查看课程