Skip to content

Commit

Permalink
✅ fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt committed Apr 25, 2024
1 parent ea52df1 commit b698436
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import threading
from pathlib import Path
from typing import Generator
from collections.abc import Generator

import pytest
from nonebot.drivers import URL
Expand Down
4 changes: 2 additions & 2 deletions tests/fake_server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import base64
from pathlib import Path
from typing import Dict, List, Union, TypeVar
from typing import Union, TypeVar

from werkzeug import Request, Response
from werkzeug.datastructures import MultiDict
Expand All @@ -26,7 +26,7 @@ def json_safe(string, content_type="application/octet-stream") -> str:
).decode("utf-8")


def flattern(d: "MultiDict[K, V]") -> Dict[K, Union[V, List[V]]]:
def flattern(d: "MultiDict[K, V]") -> dict[K, Union[V, list[V]]]:
return {k: v[0] if len(v) == 1 else v for k, v in d.to_dict(flat=False).items()}


Expand Down
4 changes: 2 additions & 2 deletions tests/test_feishu_event.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
from typing import Any
from pathlib import Path
from typing import Any, Dict, List

import pytest

Expand All @@ -10,7 +10,7 @@
@pytest.mark.asyncio
async def test_event():
with (Path(__file__).parent.joinpath("data", "events.json")).open("r") as f:
test_events: List[Dict[str, Any]] = json.load(f)
test_events: list[dict[str, Any]] = json.load(f)

for event_data in test_events:
model_name: str = event_data.pop("_model", None)
Expand Down

0 comments on commit b698436

Please sign in to comment.