1 import pytest
2 import sys
3 from TestHelper import Singleton
4 import ctypes
9 __metaclass__ = Singleton
10 test_logger = None
11 tlib_logger = None
12
13 @pytest.fixture(scope='function', autouse=True)
14 - def log(self, request, test_logger):
15 test_logger.info("======================== START %s ========================" % request.keywords.node.name)
16
17 def log_end():
18 test_logger.info("======================== END %s ========================" % request.keywords.node.name)
19
20 request.addfinalizer(log_end)
21
22
23 @pytest.fixture(scope='class', autouse=True)
33
34 @pytest.fixture()
36 """
37 Ignores the GPF dialog when a windows application crashes so that the test can continue when
38 the intention is that the application crashes
39 """
40 if sys.platform.startswith("win"):
41
42 SEM_NOGPFAULTERRORBOX = 0x0002
43 ctypes.windll.kernel32.SetErrorMode(SEM_NOGPFAULTERRORBOX);
44 subprocess_flags = 0x8000000
45 else:
46 subprocess_flags = 0
47