ソースを参照

pytest: set default timeout for each case

Chen Yudong 3 年 前
コミット
aa822339aa
2 ファイル変更6 行追加0 行削除
  1. 5 0
      conftest.py
  2. 1 0
      tools/requirements/requirements.pytest.txt

+ 5 - 0
conftest.py

@@ -308,6 +308,11 @@ class IdfPytestEmbedded:
 
         items.sort(key=lambda x: (os.path.dirname(x.path), _get_param_config(x)))
 
+        # set default timeout 10 minutes for each case
+        for item in items:
+            if 'timeout' not in item.keywords:
+                item.add_marker(pytest.mark.timeout(10 * 60))
+
         # add markers for special markers
         for item in items:
             if 'supported_targets' in item.keywords:

+ 1 - 0
tools/requirements/requirements.pytest.txt

@@ -5,6 +5,7 @@ pytest-embedded-serial-esp
 pytest-embedded-idf
 pytest-embedded-qemu
 pytest-rerunfailures
+pytest-timeout
 
 # build
 idf-build-apps