Skip to content

Commit

Permalink
Enable PTH123 rule (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Feb 6, 2025
1 parent 18badcd commit 915b85a
Show file tree
Hide file tree
Showing 87 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ ignore = [
"S105",
"PGH004",
"EXE001",
"PTH123",
"T201",
"COM812", # Conflicts with other rules
"D203", # Conflicts with other rules
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 5 additions & 4 deletions tests/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

from __future__ import annotations

import json as _json
from pathlib import Path
from typing import Optional, Union, TYPE_CHECKING
from urllib.parse import parse_qs

from aiohttp import ClientSession
from aiohttp.client_exceptions import ClientResponseError
from yarl import URL
import json as _json

if TYPE_CHECKING:
from collections.abc import Sequence
Expand All @@ -17,10 +18,10 @@
BodyType = Optional[Union[list, dict]]


def get_json(file):
def get_json(filename: str) -> dict | list:
"""Load a json file."""
with open("tests/json/" + file, encoding="utf-8") as json_file:
return _json.load(json_file)
path = Path(__package__) / "fixtures" / filename
return _json.loads(path.read_text(encoding="utf-8"))


def _get_json_fixture(body: BodyFixtureType) -> BodyType:
Expand Down

0 comments on commit 915b85a

Please sign in to comment.