10
すべての私のpytest
テストを、逐次ではなく並列で実行したいと思います。pytest run tests parallel
のように私の現在の設定に見えます:私はpytest -v -s
を使用して、私のテストを実行
class Test1(OtherClass):
@pytest.mark.parametrize("activity_name", ["activity1", "activity2"])
@pytest.mark.flaky(reruns=1)
def test_1(self, activity_name, generate_test_id):
"""
"""
test_id = generate_random_test_id()
test_name = sys._getframe().f_code.co_name
result_triggers = self.proxy(test_name, generate_test_id, test_id, activity_name)
expected_items = ["response"]
validate_response("triggers", result_triggers, expected_items)
@pytest.mark.parametrize("activity_name", ["activity1", "activity2"])
@pytest.mark.flaky(reruns=1)
def test_2(self, activity_name, generate_test_id):
"""
"""
#same idea...
。
私のテストは順番に実行されていますが、そのうちのいくつかはリモートサーバーからの応答(統合テスト)を待つため時間がかかります。
pytestを並行して実行する方法はありますか?
これはあなたが探しているようです:https://docs.pytest.org/ja/3.0.1/xdist.html –