-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathtest_deprecated.py
More file actions
29 lines (22 loc) · 788 Bytes
/
test_deprecated.py
File metadata and controls
29 lines (22 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Test deprecated features."""
from __future__ import annotations
import pytest
import libtcodpy
import tcod
import tcod.event
import tcod.libtcodpy
# ruff: noqa: D103
@pytest.mark.filterwarnings("error")
def test_deprecate_color() -> None:
with pytest.raises(FutureWarning, match=r".*\(0, 0, 0\)"):
_ = tcod.black
with pytest.raises(FutureWarning, match=r".*\(0, 0, 0\)"):
_ = tcod.libtcodpy.black
with pytest.raises(FutureWarning, match=r".*\(0, 0, 0\)"):
_ = libtcodpy.black
@pytest.mark.filterwarnings("error")
def test_deprecate_key_constants() -> None:
with pytest.raises(FutureWarning, match=r".*KeySym.N1"):
_ = tcod.event.K_1
with pytest.raises(FutureWarning, match=r".*Scancode.N1"):
_ = tcod.event.SCANCODE_1