Skip to content

Commit

Permalink
Use orjson in tests (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
bieniu committed Nov 10, 2023
1 parent e00e29c commit d78c7b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ repos:
rev: v0.1.5
hooks:
- id: ruff
args:
- --fix
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
Expand Down
10 changes: 5 additions & 5 deletions tests/test_init.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Tests for accuweather package."""
import json
from http import HTTPStatus

import aiohttp
import orjson
import pytest
from aiohttp import ClientSession
from aioresponses import aioresponses
Expand All @@ -27,28 +27,28 @@
def location_data():
"""Location data fixture."""
with open("tests/fixtures/location_data.json", encoding="utf-8") as file:
return json.load(file)
return orjson.loads(file.read())


@pytest.fixture()
def current_condition_data():
"""Weather current condition data fixture."""
with open("tests/fixtures/current_condition_data.json", encoding="utf-8") as file:
return json.load(file)
return orjson.loads(file.read())


@pytest.fixture()
def daily_forecast_data():
"""Daily forecast data fixture."""
with open("tests/fixtures/daily_forecast_data.json", encoding="utf-8") as file:
return json.load(file)
return orjson.loads(file.read())


@pytest.fixture()
def hourly_forecast_data():
"""Hourly forecast data fixture."""
with open("tests/fixtures/hourly_forecast_data.json", encoding="utf-8") as file:
return json.load(file)
return orjson.loads(file.read())


@pytest.mark.asyncio
Expand Down

0 comments on commit d78c7b5

Please sign in to comment.