浏览代码

Merge pull request #8464 from aws-lumberyard-dev/GHI8452_FixPytestWarning_CannotCollectTestClass

Fixes PyTest Warning: Cannot Collect Test Class 'TestData'
Gene Walters 3 年之前
父节点
当前提交
9dfa996966
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Tools/LyTestTools/ly_test_tools/o3de/editor_test.py

+ 2 - 0
Tools/LyTestTools/ly_test_tools/o3de/editor_test.py

@@ -332,6 +332,8 @@ class EditorTestSuite:
     _TEST_FAIL_RETCODE = 0xF  # Return code for test failure
 
     class TestData:
+        __test__ = False  # Required to tell PyTest to skip collecting this class even though it has "Test" in the name; avoids PyTest warnings.
+
         def __init__(self):
             self.results = {}  # Dict of str(test_spec.__name__) -> Result
             self.asset_processor = None