Skip to content

Commit

Permalink
Remove StrEnum tests due to mypy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Nov 22, 2024
1 parent 99cbb42 commit 63b576f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
12 changes: 0 additions & 12 deletions py-polars/tests/unit/datatypes/test_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import enum
import operator
import re
import sys
from datetime import date
from textwrap import dedent
from typing import Any, Callable
Expand Down Expand Up @@ -63,17 +62,6 @@ class PythonEnum(int, enum.Enum):
pl.Enum(PythonEnum)


@pytest.mark.skipif(sys.version_info < (3, 11), reason="Requires Python 3.11 or later")
def test_enum_init_python_strenum_19724() -> None:
class PythonEnum(enum.StrEnum):
CAT1 = "A"
CAT2 = "B"
CAT3 = "C"

result = pl.Enum(PythonEnum)
assert result == pl.Enum(["A", "B", "C"])


def test_enum_non_existent() -> None:
with pytest.raises(
InvalidOperationError,
Expand Down
13 changes: 0 additions & 13 deletions py-polars/tests/unit/datatypes/test_parse.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import enum
import sys
from datetime import date, datetime
from typing import (
TYPE_CHECKING,
Expand Down Expand Up @@ -66,18 +65,6 @@ class PythonEnum(int, enum.Enum):
parse_into_dtype(PythonEnum)


@pytest.mark.skipif(sys.version_info < (3, 11), reason="Requires Python 3.11 or later")
def test_parse_into_dtype_strenum_19724() -> None:
class PythonEnum(enum.StrEnum):
CAT1 = "A"
CAT2 = "B"
CAT3 = "C"

result = parse_into_dtype(PythonEnum)
expected = pl.Enum(["A", "B", "C"])
assert_dtype_equal(result, expected)


@pytest.mark.parametrize(
("input", "expected"),
[
Expand Down

0 comments on commit 63b576f

Please sign in to comment.