File: common.py

package info (click to toggle)
pyseventeentrack 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 296 kB
  • sloc: python: 996; sh: 59; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 549 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Define common test utilities."""

import os

import pytest
from aresponses import ResponsesMockServer  # type: ignore

TEST_EMAIL = "user@email.com"
TEST_PASSWORD = "password"


@pytest.fixture(autouse=True)
async def aresponses(loop):
    """replace aresponses"""
    async with ResponsesMockServer(loop=loop) as server:
        yield server


def load_fixture(filename):
    """Load a fixture."""
    path = os.path.join(os.path.dirname(__file__), "fixtures", filename)
    with open(path, encoding="utf-8") as fptr:
        return fptr.read()