【问题标题】:unittest discover with pattern for multiple filesunittest 发现多个文件的模式
【发布时间】:2021-05-26 14:51:03
【问题描述】:

将多个文件传递给 unittest discover 中的模式的方法是什么?
看起来它正在使用 Shell 模式,从源代码中我看到使用了 fnmatch

目标是同时运行多个从 CPython 开始的 IronPython 作业(我们需要跨平台的 func)

C:\IronPython\net45\ipy.exe -m unittest discover -s C:\git\TEST\Common -p "test1.py test2.py" -t C:\git\TEST\Common

是否可以将多个文件作为单元测试的模式传递?

【问题讨论】:

    标签: python python-unittest ironpython


    【解决方案1】:

    您可以一个接一个地添加多个 -p 参数,例如-p arg1 -p arg2.

    在你的情况下, C:\IronPython\net45\ipy.exe -m unittest discover -s C:\git\TEST\Common -p "test1.py" -p "test2.py" -t C:\git\TEST\Common 应该可以解决问题!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-07
      相关资源
      最近更新 更多