Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- to launch tests: pytest --capture=sys -v
- """
- import pytest
- from app import logs
- from conf import CONNT, NAME
- # All test coroutines will be treated as marked with this decorator.
- pytestmark = pytest.mark.asyncio
- async def test_logs_no_exception():
- """
- Assert log raises no exception.
- """
- try:
- await logs(CONT, NAME)
- except Exception as ex:
- assert False, f'logs raised an exception - {ex}'
- async def test_logs_stdout(capsys):
- """
- Assert logs outputs info to stdout with the correct name
- """
- await logs(CONT, NAME)
- captured = capsys.readouterr()
- assert captured.out.find(NAME) != -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement