【问题标题】:SciPy/pytest: Skip specific testSciPy/pytest:跳过特定测试
【发布时间】:2018-12-30 13:34:32
【问题描述】:

我使用测试我的 SciPy 安装

python -c "import scipy; scipy.test('full', verbose=2)"

单个测试 (test_face) 失败,而所有其他测试通过或 xfails。这个测试失败了,因为缺少依赖 bz2,这很好。如何指定我想完全跳过此测试,同时仍运行所有其他测试?

我正在使用 SciPy 1.2.0 和 pytest 4.0.2。

【问题讨论】:

    标签: python python-3.x unit-testing scipy pytest


    【解决方案1】:

    我使用 extra_argv 参数找到了一个可行的解决方案,该参数将参数传递给 pytest。从pytest docs 开始,-k "not test_face" 可用于完全跳过此测试。总而言之,

    python -c "import scipy; scipy.test('full', verbose=2, extra_argv=['-k not test_face'])"
    

    达到我想要的。

    【讨论】:

      猜你喜欢
      • 2018-01-22
      • 2014-04-24
      • 2013-03-28
      • 1970-01-01
      • 2019-02-14
      • 2021-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多