Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def tearDown(self):
registry.clear()
from getgauge.messages.messages_pb2 import Message
from getgauge.registry import registry, MessagesStore, ScreenshotsStore
from getgauge.python import (Messages, DataStore, DataStoreFactory, DictObject,
DataStoreContainer, data_store, Table, Specification,
Scenario, Step, ExecutionContext,
create_execution_context_from)
from uuid import uuid1
import os
import tempfile
try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping
registry.clear()
class MessagesTests(TestCase):
def test_pending_messages(self):
messages = ['HAHAHAH', 'HAHAHAH1', 'HAHAHAH2', 'HAHAHAH3']
for message in messages:
Messages.write_message(message)
pending_messages = MessagesStore.pending_messages()
self.assertEqual(messages, pending_messages)
def test_clear(self):
messages = ['HAHAHAH', 'HAHAHAH1', 'HAHAHAH2', 'HAHAHAH3']
for message in messages:
Messages.write_message(message)
MessagesStore.clear()
pending_messages = MessagesStore.pending_messages()
def setUp(self):
registry.clear()
self.setUpPyfakefs()
def tearDown(self):
registry.clear()
def setUp(self):
registry.clear()
def setUp(self):
registry.clear()
self.setUpPyfakefs()
def tearDown(self):
registry.clear()
def process_execution_starting_request(request, clear=True):
if clear:
registry.clear()
load_impls(get_step_impl_dirs())
execution_info = create_execution_context_from(
request.currentExecutionInfo)
response = run_hook(request, registry.before_suite(), execution_info)
_add_message_and_screenshots(response)
return response