py.test

    1熱度

    1回答

    我有測試用例。 測試用例有10個獨立的步驟。 第一步失敗時,另一步不執行。 我該怎麼做才能繼續測試? 例如: with allure.step('Проверка, что после явной отписки освобождаются pullpoint`ы'): for i in range(0, kMaxPullPoints + 5): ... with allur

    2熱度

    1回答

    問題是我給定的fixture函數有一個外部依賴關係,導致一個「錯誤」(如無法訪問的網絡/資源不足等)。 我想跳過夾具,然後跳過依賴此夾具的任何測試。 做這樣的事情不會工作: import pytest @pytest.mark.skip(reason="Something.") @pytest.fixture(scope="module") def parametrized_usernam

    1熱度

    2回答

    早些時候,我在我的項目中使用python unittest,並且它來到了unittest.TextTestRunner和unittest.defaultTestLoader.loadTestsFromTestCase。我使用它們的原因如下: 使用調用unittests的run方法的包裝函數來控制unittest的執行。我不想要命令行方法。 從結果對象中讀取unittest的輸出並將結果上傳到一個b

    2熱度

    2回答

    我在一個文件中有60個功能測試。我用Notepad ++編寫了它們,並使用py.test作爲測試框架。今天我決定用PyCharm交換Notepad ++。我從PyCharm打開我的PyCharm功能測試文件,並運行測試,你可以在圖片中看到: 現在,確認我可以運行所有的測試後,我試圖運行一個單獨的測試,例如test_login_with_extantUser_using_email。在邏輯上,我右鍵

    1熱度

    1回答

    在Pytest中,我正在嘗試做下面的事情,我需要保存先前的結果,並將當前/當前結果與先前的結果進行多次迭代比較。 我已經做了如下方法: @pytest.mark.parametrize("iterations",[1,2,3,4,5]) ------> for 5 iterations @pytest.mark.parametrize("clsObj",[(1,2,3)],indirect =

    -1熱度

    1回答

    我正在使用pytest燈具和良率。但是,試圖讓值產生回報 conftest.py @pytest.fixture() def driver_setup(): driver = webdriver.Firefox() yield driver driver.quit() basetest.py @pytest.mark.usefixtures("driver_se

    0熱度

    1回答

    當交互式控制檯上運行此代碼: >>> import sys >>> sys.path.append("/path/to/mypkg") >>> import mypkg.src.dbwrapper as dbw 但不喜歡這樣: $ cd /path/to/mypkg $ python py -m pytest mypkg/src/dbwrapper_queries.py:3: in <

    0熱度

    1回答

    假設我有一個模塊,做這樣的事情: try: from foo import bar except ImportError: def bar(): pass 如何測試except ImportError塊與pytest?

    1熱度

    1回答

    有一個基本測試 from aiohttp import web async def hello(request): return web.Response(text='Hello, world') async def test_hello(test_client, loop): app = web.Application() app.router.add_ge

    0熱度

    1回答

    如何抑制打印頭(〜4行)? ============================= test session starts ============================== platform linux -- Python 3.5.3, pytest-3.2.1, py-1.4.34, pluggy-0.4.0 -- /usr/bin/python3 cachedir: .ca