def METHOD_NAME(self) -> None:
    # treat warning as exception for testing
    self.push_warning_as_exception(MSVCScriptExecutionWarning)
    def_policy = Policy.msvc_set_scripterror_policy('Warning')
    with self.assertRaises(MSVCScriptExecutionWarning):
        Policy.msvc_scripterror_handler(None, '')
    Policy.msvc_set_scripterror_policy('Ignore')
    with self.assertRaises(MSVCScriptExecutionWarning):
        Policy.msvc_scripterror_handler({'MSVC_SCRIPTERROR_POLICY': 'Warning'}, '')
    Policy.msvc_set_scripterror_policy(def_policy)
    self.pop_warning_as_exception()