From a251811a5422dc5af0a3e80d495ca586fa9d5cff Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Tue, 21 May 2024 23:15:48 +0200 Subject: [PATCH] Fix unit tests run on 3.8 --- mcproto/types/nbt.py | 4 ++-- tests/mcproto/test_multiplayer.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mcproto/types/nbt.py b/mcproto/types/nbt.py index e3d0375e..f1a3ce95 100644 --- a/mcproto/types/nbt.py +++ b/mcproto/types/nbt.py @@ -137,8 +137,8 @@ class NBTagType(IntEnum): bytes, str, "NBTag", - Sequence["PayloadType"], - Mapping[str, "PayloadType"], + "Sequence[PayloadType]", + "Mapping[str, PayloadType]", ] """Represents the type of a payload that can be stored in an NBT tag.""" diff --git a/tests/mcproto/test_multiplayer.py b/tests/mcproto/test_multiplayer.py index 8a8236c9..70e8bb4c 100644 --- a/tests/mcproto/test_multiplayer.py +++ b/tests/mcproto/test_multiplayer.py @@ -1,9 +1,14 @@ +from __future__ import annotations + import sys +from typing import TYPE_CHECKING from unittest.mock import Mock import httpx import pytest -from pytest_httpx import HTTPXMock + +if sys.version_info > (3, 9) or TYPE_CHECKING: + from pytest_httpx import HTTPXMock from mcproto.multiplayer import ( JoinAcknowledgeData,