MaterialEditor_Atom_ExpectsCrashFailure.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. """
  2. Copyright (c) Contributors to the Open 3D Engine Project.
  3. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. SPDX-License-Identifier: Apache-2.0 OR MIT
  5. """
  6. class Tests:
  7. material_editor_test_crashed = ( # This test result is pytest.mark.xfail.
  8. "P0: AtomToolsSingleTest class didn't crash and passed (it should fail from crashing).",
  9. "P0: AtomToolsSingleTest crashed before the test could complete (expected failure)."
  10. )
  11. def MaterialEditor_TestsTimeoutCrashFailure():
  12. """
  13. Summary:
  14. Tests that the MaterialEditor can fail from crashing in a test.
  15. Expected Behavior:
  16. The MaterialEditor test fails due to crash from calling azlmbr.atomtools.crash()
  17. Test Steps:
  18. 1) Start the MaterialEditor then force a crash and verify it fails through pytext.mark.xfail result.
  19. :return: None
  20. """
  21. import Atom.atom_utils.atom_tools_utils as atom_tools_utils
  22. from editor_python_test_tools.utils import Report, TestHelper
  23. # 1. Start the MaterialEditor then force a crash and verify it fails through pytext.mark.xfail result.
  24. Report.result(Tests.material_editor_test_crashed, atom_tools_utils.crash())
  25. if __name__ == "__main__":
  26. from editor_python_test_tools.utils import Report
  27. Report.start_test(MaterialEditor_TestsTimeoutCrashFailure)