File: conftest.py

package info (click to toggle)
pyairnow 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 228 kB
  • sloc: python: 798; makefile: 28
file content (19 lines) | stat: -rw-r--r-- 409 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'''pyAirNow pytest Fixtures'''
import pytest
import re

from aioresponses import aioresponses

from .mock_api import mock_airnow_api


@pytest.fixture
def mock_aioresponse():
    with aioresponses() as m:
        yield m


@pytest.fixture
def mock_airnowapi(mock_aioresponse):
    url_pattern = re.compile(r'^https://www\.airnowapi\.org/(.*)$')
    mock_aioresponse.get(url_pattern, callback=mock_airnow_api)