add prints around all yields for fixtures

This commit is contained in:
Anastasiya Semenkevich 2024-06-28 15:09:18 +03:00
parent 55b2a83c6f
commit 1a9e189dab
1 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,8 @@ def options(request):
@pytest.fixture @pytest.fixture
def application_logs(): def application_logs():
LOG.info('This is application logs fixture yield')
print("application logs fixture yield")
yield yield
if configs.testpath.STATUS_DATA.exists(): if configs.testpath.STATUS_DATA.exists():
for app_data in configs.testpath.STATUS_DATA.iterdir(): for app_data in configs.testpath.STATUS_DATA.iterdir():
@ -47,6 +49,8 @@ def aut(user_data) -> AUT:
if not configs.AUT_PATH.exists(): if not configs.AUT_PATH.exists():
pytest.exit(f"Application not found: {configs.AUT_PATH}") pytest.exit(f"Application not found: {configs.AUT_PATH}")
_aut = AUT(user_data=user_data) _aut = AUT(user_data=user_data)
LOG.info('This is aut fixture yield')
print("aut fixture yield")
yield _aut yield _aut
@ -57,6 +61,8 @@ def multiple_instances(user_data):
pytest.exit(f"Application not found: {configs.AUT_PATH}") pytest.exit(f"Application not found: {configs.AUT_PATH}")
return AUT(user_data=user_data) return AUT(user_data=user_data)
LOG.info('This is multiple instances fixture yield')
print("multiple instances logs fixture yield")
yield _aut yield _aut
@ -64,6 +70,8 @@ def multiple_instances(user_data):
def main_window(aut: AUT, user_data): def main_window(aut: AUT, user_data):
aut.launch() aut.launch()
LOG.debug('Waiting for main window...') LOG.debug('Waiting for main window...')
LOG.info('This is main window fixture yield')
print("main window fixture yield")
yield MainWindow().wait_until_appears().prepare() yield MainWindow().wait_until_appears().prepare()
aut.stop() aut.stop()
@ -75,6 +83,8 @@ def user_account(request) -> UserAccount:
assert isinstance(user_account, UserAccount) assert isinstance(user_account, UserAccount)
else: else:
user_account = constants.user.user_account_one user_account = constants.user.user_account_one
LOG.info('This is user account fixture yield')
print("user account fixture yield")
yield user_account yield user_account