Skip to content

Commit

Permalink
Fix unit tests run on 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDrike committed May 21, 2024
1 parent 3dbbc18 commit 859c8e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
18 changes: 9 additions & 9 deletions mcproto/types/nbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand All @@ -163,17 +163,17 @@ def to_nbt(self, name: str = "") -> NBTag:
float,
bytes,
str,
NBTagConvertible,
Sequence["FromObjectType"],
Mapping[str, "FromObjectType"],
"NBTagConvertible",
"Sequence[FromObjectType]",
"Mapping[str, FromObjectType]",
]
"""Represents any object holding some data that can be converted to an NBT tag(s)."""

FromObjectSchema: TypeAlias = Union[
type["NBTag"],
type[NBTagConvertible],
Sequence["FromObjectSchema"],
Mapping[str, "FromObjectSchema"],
"type[NBTag]",
"type[NBTagConvertible]",
"Sequence[FromObjectSchema]",
"Mapping[str, FromObjectSchema]",
]
"""Represents the type of a schema, used to define how an object should be converted to an NBT tag(s)."""

Expand Down
7 changes: 6 additions & 1 deletion tests/mcproto/test_multiplayer.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit 859c8e1

Please sign in to comment.