pytest 測(cè)試輸出和結(jié)果-管理pytest的輸出

2022-03-21 13:51 更新

修改 Python 回溯打印

修改回溯打印示例:

pytest --showlocals # show local variables in tracebacks
pytest -l           # show local variables (shortcut)

pytest --tb=auto    # (default) 'long' tracebacks for the first and last
                     # entry, but 'short' style for the other entries
pytest --tb=long    # exhaustive, informative traceback formatting
pytest --tb=short   # shorter traceback format
pytest --tb=line    # only one line per failure
pytest --tb=native  # Python standard library formatting
pytest --tb=no      # no traceback at all

?--full-trace? 導(dǎo)致在錯(cuò)誤時(shí)打印很長(zhǎng)的跟蹤(長(zhǎng)于 ?--tb=long?)。 它還確保在 ?KeyboardInterrupt(Ctrl+C) 上打印堆棧跟蹤。 如果測(cè)試花費(fèi)的時(shí)間太長(zhǎng)并且您使用 Ctrl+C 中斷它們以找出測(cè)試掛起的位置,這將非常有用。 默認(rèn)情況下不會(huì)顯示任何輸出(因?yàn)?nbsp;?KeyboardInterrupt被 pytest 捕獲)。 通過(guò)使用此選項(xiàng),您可以確保顯示跟蹤。

冗長(zhǎng)

?-v? 標(biāo)志在各個(gè)方面控制 pytest 輸出的詳細(xì)程度:測(cè)試會(huì)話進(jìn)度、測(cè)試失敗時(shí)的斷言詳細(xì)信息、帶有 ?--fixtures? 的固定詳細(xì)信息等。

考慮這個(gè)簡(jiǎn)單的文件:

# content of test_verbosity_example.py
def test_ok():
    pass


def test_words_fail():
    fruits1 = ["banana", "apple", "grapes", "melon", "kiwi"]
    fruits2 = ["banana", "apple", "orange", "melon", "kiwi"]
    assert fruits1 == fruits2


def test_numbers_fail():
    number_to_text1 = {str(x): x for x in range(5)}
    number_to_text2 = {str(x * 10): x * 10 for x in range(5)}
    assert number_to_text1 == number_to_text2


def test_long_text_fail():
    long_text = "Lorem ipsum dolor sit amet " * 10
    assert "hello world" in long_text

執(zhí)行 pytest 通常會(huì)給我們這個(gè)輸出:

$ pytest --no-header
=========================== test session starts ============================
collected 4 items

test_verbosity_example.py .FFF                                       [100%]

================================= FAILURES =================================
_____________________________ test_words_fail ______________________________

    def test_words_fail():
        fruits1 = ["banana", "apple", "grapes", "melon", "kiwi"]
        fruits2 = ["banana", "apple", "orange", "melon", "kiwi"]
>       assert fruits1 == fruits2
E       AssertionError: assert ['banana', 'a...elon', 'kiwi'] == ['banana', 'a...elon', 'kiwi']
E         At index 2 diff: 'grapes' != 'orange'
E         Use -v to get more diff

test_verbosity_example.py:8: AssertionError
____________________________ test_numbers_fail _____________________________

    def test_numbers_fail():
        number_to_text1 = {str(x): x for x in range(5)}
        number_to_text2 = {str(x * 10): x * 10 for x in range(5)}
>       assert number_to_text1 == number_to_text2
E       AssertionError: assert {'0': 0, '1':..., '3': 3, ...} == {'0': 0, '10'...'30': 30, ...}
E         Omitting 1 identical items, use -vv to show
E         Left contains 4 more items:
E         {'1': 1, '2': 2, '3': 3, '4': 4}
E         Right contains 4 more items:
E         {'10': 10, '20': 20, '30': 30, '40': 40}
E         Use -v to get more diff

test_verbosity_example.py:14: AssertionError
___________________________ test_long_text_fail ____________________________

    def test_long_text_fail():
        long_text = "Lorem ipsum dolor sit amet " * 10
>       assert "hello world" in long_text
E       AssertionError: assert 'hello world' in 'Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ips... sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet '

test_verbosity_example.py:19: AssertionError
========================= short test summary info ==========================
FAILED test_verbosity_example.py::test_words_fail - AssertionError: asser...
FAILED test_verbosity_example.py::test_numbers_fail - AssertionError: ass...
FAILED test_verbosity_example.py::test_long_text_fail - AssertionError: a...
======================= 3 failed, 1 passed in 0.12s ========================

請(qǐng)注意:

  • 文件中的每個(gè)測(cè)試都由輸出中的單個(gè)字符顯示:?.?為 通過(guò),?F? 為失敗。
  • ?test_words_fail ?失敗,我們看到一個(gè)簡(jiǎn)短的摘要,表明兩個(gè)列表的索引 2 不同。
  • ?test_numbers_fail ?失敗,我們會(huì)看到字典項(xiàng)目左右差異的摘要。 相同的項(xiàng)目被省略。
  • ?test_long_text_fail ?失敗,并且 ?in ?語(yǔ)句的右側(cè)使用 ?...`? 被截?cái)啵驗(yàn)樗葍?nèi)部閾值長(zhǎng)(當(dāng)前為 240 個(gè)字符)。

現(xiàn)在我們可以增加 pytest 的詳細(xì)程度:

$ pytest --no-header -v
=========================== test session starts ============================
collecting ... collected 4 items

test_verbosity_example.py::test_ok PASSED                            [ 25%]
test_verbosity_example.py::test_words_fail FAILED                    [ 50%]
test_verbosity_example.py::test_numbers_fail FAILED                  [ 75%]
test_verbosity_example.py::test_long_text_fail FAILED                [100%]

================================= FAILURES =================================
_____________________________ test_words_fail ______________________________

    def test_words_fail():
        fruits1 = ["banana", "apple", "grapes", "melon", "kiwi"]
        fruits2 = ["banana", "apple", "orange", "melon", "kiwi"]
>       assert fruits1 == fruits2
E       AssertionError: assert ['banana', 'a...elon', 'kiwi'] == ['banana', 'a...elon', 'kiwi']
E         At index 2 diff: 'grapes' != 'orange'
E         Full diff:
E         - ['banana', 'apple', 'orange', 'melon', 'kiwi']
E         ?                      ^  ^^
E         + ['banana', 'apple', 'grapes', 'melon', 'kiwi']
E         ?                      ^  ^ +

test_verbosity_example.py:8: AssertionError
____________________________ test_numbers_fail _____________________________

    def test_numbers_fail():
        number_to_text1 = {str(x): x for x in range(5)}
        number_to_text2 = {str(x * 10): x * 10 for x in range(5)}
>       assert number_to_text1 == number_to_text2
E       AssertionError: assert {'0': 0, '1':..., '3': 3, ...} == {'0': 0, '10'...'30': 30, ...}
E         Omitting 1 identical items, use -vv to show
E         Left contains 4 more items:
E         {'1': 1, '2': 2, '3': 3, '4': 4}
E         Right contains 4 more items:
E         {'10': 10, '20': 20, '30': 30, '40': 40}
E         Full diff:
E         - {'0': 0, '10': 10, '20': 20, '30': 30, '40': 40}...
E
E         ...Full output truncated (3 lines hidden), use '-vv' to show

test_verbosity_example.py:14: AssertionError
___________________________ test_long_text_fail ____________________________

    def test_long_text_fail():
        long_text = "Lorem ipsum dolor sit amet " * 10
>       assert "hello world" in long_text
E       AssertionError: assert 'hello world' in 'Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet '

test_verbosity_example.py:19: AssertionError
========================= short test summary info ==========================
FAILED test_verbosity_example.py::test_words_fail - AssertionError: asser...
FAILED test_verbosity_example.py::test_numbers_fail - AssertionError: ass...
FAILED test_verbosity_example.py::test_long_text_fail - AssertionError: a...
======================= 3 failed, 1 passed in 0.12s ========================

現(xiàn)在請(qǐng)注意:

  • 文件中的每個(gè)測(cè)試在輸出中都有自己的行。
  • ?test_words_fail ?現(xiàn)在完整顯示兩個(gè)失敗列表,除了索引不同。
  • ?test_numbers_fail ?現(xiàn)在顯示兩個(gè)字典的文本差異,被截?cái)唷?/li>
  • ?test_long_text_fail ?不再截?cái)?code>in語(yǔ)句的右側(cè),因?yàn)榻財(cái)嗟膬?nèi)部閾值現(xiàn)在更大(當(dāng)前為 2400 個(gè)字符)。

現(xiàn)在,如果我們進(jìn)一步增加詳細(xì)程度:

$ pytest --no-header -vv
=========================== test session starts ============================
collecting ... collected 4 items

test_verbosity_example.py::test_ok PASSED                            [ 25%]
test_verbosity_example.py::test_words_fail FAILED                    [ 50%]
test_verbosity_example.py::test_numbers_fail FAILED                  [ 75%]
test_verbosity_example.py::test_long_text_fail FAILED                [100%]

================================= FAILURES =================================
_____________________________ test_words_fail ______________________________

    def test_words_fail():
        fruits1 = ["banana", "apple", "grapes", "melon", "kiwi"]
        fruits2 = ["banana", "apple", "orange", "melon", "kiwi"]
>       assert fruits1 == fruits2
E       AssertionError: assert ['banana', 'apple', 'grapes', 'melon', 'kiwi'] == ['banana', 'apple', 'orange', 'melon', 'kiwi']
E         At index 2 diff: 'grapes' != 'orange'
E         Full diff:
E         - ['banana', 'apple', 'orange', 'melon', 'kiwi']
E         ?                      ^  ^^
E         + ['banana', 'apple', 'grapes', 'melon', 'kiwi']
E         ?                      ^  ^ +

test_verbosity_example.py:8: AssertionError
____________________________ test_numbers_fail _____________________________

    def test_numbers_fail():
        number_to_text1 = {str(x): x for x in range(5)}
        number_to_text2 = {str(x * 10): x * 10 for x in range(5)}
>       assert number_to_text1 == number_to_text2
E       AssertionError: assert {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4} == {'0': 0, '10': 10, '20': 20, '30': 30, '40': 40}
E         Common items:
E         {'0': 0}
E         Left contains 4 more items:
E         {'1': 1, '2': 2, '3': 3, '4': 4}
E         Right contains 4 more items:
E         {'10': 10, '20': 20, '30': 30, '40': 40}
E         Full diff:
E         - {'0': 0, '10': 10, '20': 20, '30': 30, '40': 40}
E         ?            -    -    -    -    -    -    -    -
E         + {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4}

test_verbosity_example.py:14: AssertionError
___________________________ test_long_text_fail ____________________________

    def test_long_text_fail():
        long_text = "Lorem ipsum dolor sit amet " * 10
>       assert "hello world" in long_text
E       AssertionError: assert 'hello world' in 'Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet '

test_verbosity_example.py:19: AssertionError
========================= short test summary info ==========================
FAILED test_verbosity_example.py::test_words_fail - AssertionError: asser...
FAILED test_verbosity_example.py::test_numbers_fail - AssertionError: ass...
FAILED test_verbosity_example.py::test_long_text_fail - AssertionError: a...
======================= 3 failed, 1 passed in 0.12s ========================

現(xiàn)在請(qǐng)注意:

  • 文件中的每個(gè)測(cè)試在輸出中都有自己的行。
  • 在這種情況下,?test_words_fail給出與以前相同的輸出。
  • ?test_numbers_fail現(xiàn)在顯示兩個(gè)字典的全文差異。
  • ?test_long_text_fail也不會(huì)像以前那樣在右側(cè)截?cái)啵F(xiàn)在 pytest 根本不會(huì)截?cái)嗳魏挝谋?,無(wú)論其大小。

這些是詳細(xì)程度如何影響正常測(cè)試會(huì)話輸出的示例,但詳細(xì)程度也用于其他情況,例如,如果您使用 ?pytest --fixtures -v?,甚至?xí)@示以開頭的?fixture?。

支持使用更高的詳細(xì)級(jí)別(?-vvv?,?-vvvv?,...),但目前對(duì) pytest 本身沒有影響,但是某些插件可能會(huì)使用更高的詳細(xì)級(jí)別。

制作詳細(xì)的總結(jié)報(bào)告

?-r? 標(biāo)志可用于在測(cè)試會(huì)話結(jié)束時(shí)顯示簡(jiǎn)短的測(cè)試摘要信息,從而在大型測(cè)試套件中輕松獲得所有失敗、跳過(guò)、?xfails等的清晰圖片。

它默認(rèn)為 ?fE以列出失敗和錯(cuò)誤。

例如:

# content of test_example.py
import pytest


@pytest.fixture
def error_fixture():
    assert 0


def test_ok():
    print("ok")


def test_fail():
    assert 0


def test_error(error_fixture):
    pass


def test_skip():
    pytest.skip("skipping this test")


def test_xfail():
    pytest.xfail("xfailing this test")


@pytest.mark.xfail(reason="always xfail")
def test_xpass():
    pass
$ pytest -ra
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
rootdir: /home/sweet/project
collected 6 items

test_example.py .FEsxX                                               [100%]

================================== ERRORS ==================================
_______________________ ERROR at setup of test_error _______________________

    @pytest.fixture
    def error_fixture():
>       assert 0
E       assert 0

test_example.py:6: AssertionError
================================= FAILURES =================================
________________________________ test_fail _________________________________

    def test_fail():
>       assert 0
E       assert 0

test_example.py:14: AssertionError
========================= short test summary info ==========================
SKIPPED [1] test_example.py:22: skipping this test
XFAIL test_example.py::test_xfail
  reason: xfailing this test
XPASS test_example.py::test_xpass always xfail
ERROR test_example.py::test_error - assert 0
FAILED test_example.py::test_fail - assert 0
== 1 failed, 1 passed, 1 skipped, 1 xfailed, 1 xpassed, 1 error in 0.12s ===

?-r? 選項(xiàng)接受其后的多個(gè)字符,上面使用的 ?a? 表示除通過(guò)之外的所有字符。

以下是可以使用的可用字符的完整列表:

  • ?f- 失敗
  • ?E- 錯(cuò)誤
  • ?s- 跳過(guò)
  • ?x- xfailed
  • ?X- xpassed
  • ?p- 通過(guò)
  • ?P- 通過(guò)輸出

取消選擇組的特殊字符:

  • ?a- 除 ?pP外的所有
  • ?A- 全部
  • ?N- 無(wú),這可用于不顯示任何內(nèi)容(因?yàn)?nbsp;?fE是默認(rèn)值)

可以使用多個(gè)字符,例如只查看失敗和跳過(guò)的測(cè)試,您可以執(zhí)行:

$ pytest -rfs
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
rootdir: /home/sweet/project
collected 6 items

test_example.py .FEsxX                                               [100%]

================================== ERRORS ==================================
_______________________ ERROR at setup of test_error _______________________

    @pytest.fixture
    def error_fixture():
>       assert 0
E       assert 0

test_example.py:6: AssertionError
================================= FAILURES =================================
________________________________ test_fail _________________________________

    def test_fail():
>       assert 0
E       assert 0

test_example.py:14: AssertionError
========================= short test summary info ==========================
FAILED test_example.py::test_fail - assert 0
SKIPPED [1] test_example.py:22: skipping this test
== 1 failed, 1 passed, 1 skipped, 1 xfailed, 1 xpassed, 1 error in 0.12s ===

使用 ?p列出通過(guò)的測(cè)試,而 ?P添加一個(gè)額外的部分“PASSES”,其中包含那些通過(guò)但已捕獲輸出的測(cè)試:

$ pytest -rpP
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
rootdir: /home/sweet/project
collected 6 items

test_example.py .FEsxX                                               [100%]

================================== ERRORS ==================================
_______________________ ERROR at setup of test_error _______________________

    @pytest.fixture
    def error_fixture():
>       assert 0
E       assert 0

test_example.py:6: AssertionError
================================= FAILURES =================================
________________________________ test_fail _________________________________

    def test_fail():
>       assert 0
E       assert 0

test_example.py:14: AssertionError
================================== PASSES ==================================
_________________________________ test_ok __________________________________
--------------------------- Captured stdout call ---------------------------
ok
========================= short test summary info ==========================
PASSED test_example.py::test_ok
== 1 failed, 1 passed, 1 skipped, 1 xfailed, 1 xpassed, 1 error in 0.12s ===

創(chuàng)建結(jié)果日志格式文件

要?jiǎng)?chuàng)建純文本機(jī)器可讀的結(jié)果文件,您可以:

pytest --resultlog=path

查看路徑位置的內(nèi)容。使用此類文件,例如通過(guò) PyPy-test 網(wǎng)頁(yè)顯示多個(gè)修訂版的測(cè)試結(jié)果。

創(chuàng)建 JUnitXML 格式文件

要?jiǎng)?chuàng)建 ?Jenkins或其他持續(xù)集成服務(wù)器可以讀取的結(jié)果文件,請(qǐng)使用以下調(diào)用:

pytest --junitxml=path

創(chuàng)建一個(gè)XML文件在路徑。

要設(shè)置root測(cè)試套件的名稱,你可以在配置文件中配置?junit_suite_name?選項(xiàng):

[pytest]
junit_suite_name = my_suite

?JUnit XML? 規(guī)范似乎表明時(shí)間屬性應(yīng)該報(bào)告總測(cè)試執(zhí)行時(shí)間,包括設(shè)置和拆卸 (1, 2)。 這是默認(rèn)的 pytest 行為。 要僅報(bào)告通話持續(xù)時(shí)間,請(qǐng)配置 ?junit_duration_report ?選項(xiàng),如下所示:

[pytest]
junit_duration_report = call

record_property

如果要記錄測(cè)試的其他信息,可以使用 ?record_property fixture?:

def test_function(record_property):
    record_property("example_key", 1)
    assert True

這將為生成的測(cè)試用例標(biāo)簽添加一個(gè)額外的屬性 ?example_key="1"?:

<testcase classname="test_function" file="test_function.py" line="0" name="test_function" time="0.0009">
  <properties>
    <property name="example_key" value="1" />
  </properties>
</testcase>

或者,您可以將此功能與自定義標(biāo)記集成:

# content of conftest.py


def pytest_collection_modifyitems(session, config, items):
    for item in items:
        for marker in item.iter_markers(name="test_id"):
            test_id = marker.args[0]
            item.user_properties.append(("test_id", test_id))

在你的測(cè)試中:

# content of test_function.py
import pytest


@pytest.mark.test_id(1501)
def test_function():
    assert True

結(jié)果如下:

<testcase classname="test_function" file="test_function.py" line="0" name="test_function" time="0.0009">
  <properties>
    <property name="test_id" value="1501" />
  </properties>
</testcase>

請(qǐng)注意,使用此功能將破壞最新 ?JUnitXML模式的模式驗(yàn)證。 當(dāng)與某些 ?CI服務(wù)器一起使用時(shí),這可能是一個(gè)問題。

record_xml_attribute

要向?testcase?元素添加額外的xml屬性,可以使用?record_xml_attribute fixture?。這也可以用來(lái)覆蓋現(xiàn)有的值:

def test_function(record_xml_attribute):
    record_xml_attribute("assertions", "REQ-1234")
    record_xml_attribute("classname", "custom_classname")
    print("hello world")
    assert True

與 ??record_property?不同,這不會(huì)添加新的子元素。 相反,這將在生成的測(cè)試用例標(biāo)簽內(nèi)添加一個(gè)屬性 ??assertions="REQ-1234"? ?并用 ??"classname=custom_classname?"? 覆蓋默認(rèn)類名:

<testcase classname="custom_classname" file="test_function.py" line="0" name="test_function" time="0.003" assertions="REQ-1234">
    <system-out>
        hello world
    </system-out>
</testcase>

?record_xml_attribute是一個(gè)實(shí)驗(yàn)性功能,在未來(lái)的版本中,它的界面可能會(huì)被更強(qiáng)大和更通用的東西所取代。 然而,功能本身將被保留。

在使用 ?ci工具解析 ?xml報(bào)告時(shí),在 ?record_xml_property上使用它會(huì)有所幫助。 但是,一些解析器對(duì)允許的元素和屬性非常嚴(yán)格。 許多工具使用 ?xsd模式來(lái)驗(yàn)證傳入的 ?xml?。 確保您使用的是解析器允許的屬性名稱。

以下是 ?Jenkins用于驗(yàn)證 ?XML報(bào)告的方案:

<xs:element name="testcase">
    <xs:complexType>
        <xs:sequence>
            <xs:element ref="skipped" minOccurs="0" maxOccurs="1"/>
            <xs:element ref="error" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="failure" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="system-out" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="system-err" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="assertions" type="xs:string" use="optional"/>
        <xs:attribute name="time" type="xs:string" use="optional"/>
        <xs:attribute name="classname" type="xs:string" use="optional"/>
        <xs:attribute name="status" type="xs:string" use="optional"/>
    </xs:complexType>
</xs:element>

請(qǐng)注意,使用此功能將破壞最新 ?JUnitXML模式的模式驗(yàn)證。 當(dāng)與某些 ?CI服務(wù)器一起使用時(shí),這可能是一個(gè)問題。

record_testsuite_property

如果你想在測(cè)試套件級(jí)別添加一個(gè)屬性節(jié)點(diǎn),它可能包含與所有測(cè)試相關(guān)的屬性,你可以使用?record_testsuite_property?會(huì)話范圍的?fixture?:

?record_testsuite_property?會(huì)話范圍的?fixture?可用于添加與所有測(cè)試相關(guān)的屬性。

import pytest


@pytest.fixture(scope="session", autouse=True)
def log_global_env_facts(record_testsuite_property):
    record_testsuite_property("ARCH", "PPC")
    record_testsuite_property("STORAGE_TYPE", "CEPH")


class TestMe:
    def test_foo(self):
        assert True

這個(gè)?fixture?是一個(gè)可調(diào)用對(duì)象,它接收在生成的?xml?的測(cè)試套件級(jí)別添加的<屬性>標(biāo)簽的名稱和值:

<testsuite errors="0" failures="0" name="pytest" skipped="0" tests="1" time="0.006">
  <properties>
    <property name="ARCH" value="PPC"/>
    <property name="STORAGE_TYPE" value="CEPH"/>
  </properties>
  <testcase classname="test_me.TestMe" file="test_me.py" line="16" name="test_foo" time="0.000243663787842"/>
</testsuite>

名稱必須是一個(gè)字符串,值將轉(zhuǎn)換為字符串和正確的?xml?轉(zhuǎn)義。

生成的?XML?兼容最新的?xunit?標(biāo)準(zhǔn),而不是?record_property?和?record_xml_attribute?。

將測(cè)試報(bào)告發(fā)送到online pastebin service

為每個(gè)測(cè)試失敗創(chuàng)建一個(gè) URL:

pytest --pastebin=failed

這會(huì)將測(cè)試運(yùn)行信息提交到遠(yuǎn)程粘貼服務(wù),并為每個(gè)失敗提供一個(gè) URL。 如果您只想發(fā)送一個(gè)特定的失敗,您可以像往常一樣選擇測(cè)試或添加例如 ?-x?

為整個(gè)測(cè)試會(huì)話日志創(chuàng)建URL:

pytest——pastebin =

目前只實(shí)現(xiàn)了粘貼到?https://bpaste.net/service?

如果由于任何原因創(chuàng)建URL失敗,則會(huì)生成一個(gè)警告,而不是導(dǎo)致整個(gè)測(cè)試套件失敗。


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)