0%



test

  • 测试信息打印

    默认情况下,pytest 会捕获所有的输出。这意味着在测试运行期间, print 语句的输出不会显示在控制台上。

    如果想看到 print 语句的输出,需要使用 -s 选项来告诉 pytest 不要捕获输出

    1
    pytest -s test_web_base.py
  • 测试指定方法

    1
    pytest tests/unit_tests/document_loaders/test_web_base.py::类名::方法名
  • 测试被标记的方法

    1
    2
    3
    @pytest.mark.finished
    def test_func1():
    assert 1 == 1
    1
    pytest -m finished tests/test-function/test_with_mark.py