25 lines
464 B
Python
25 lines
464 B
Python
|
import pytest
|
||
|
|
||
|
from typing import TYPE_CHECKING, Optional
|
||
|
|
||
|
if TYPE_CHECKING:
|
||
|
from mastodon import Mastodon
|
||
|
from diyalgo import Config
|
||
|
|
||
|
from diyalgo.client.init import log_in
|
||
|
|
||
|
@pytest.fixture(scope="session")
|
||
|
def client_fixture(config:Optional['Config'] = None) -> 'Mastodon':
|
||
|
"""
|
||
|
A logged in client with the default credentials (in an .env file atm)
|
||
|
|
||
|
Returns:
|
||
|
|
||
|
"""
|
||
|
client = log_in(config)
|
||
|
|
||
|
yield client
|
||
|
|
||
|
client.session.close()
|
||
|
|