Skip to content

Commit 6e335a7

Browse files
committed
More CI test fixes
1 parent daf522b commit 6e335a7

File tree

5 files changed

+20
-58
lines changed

5 files changed

+20
-58
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,25 @@ jobs:
2525
uses: actions/setup-python@v4
2626
with:
2727
python-version: ${{ matrix.python-version }}
28-
architecture: ${{ matrix.architecture }}
28+
architecture: ${{ matrix-python-version }}
2929
- name: dependencies
3030
run: |
3131
python -m pip install -U pip wheel setuptools
3232
- name: wheel
3333
run: |
3434
python -m pip install -e .[tests]
35+
- name: flake8
36+
run: |
37+
flake8 pytiled_parser
38+
- name: mypy
39+
if: success() || failure()
40+
run: |
41+
mypy pytiled_parser
42+
- name: black
43+
if: success() || failure()
44+
run: |
45+
black pytiled_parser --check
3546
- name: pytest
47+
if: success() || failure()
3648
run: |
37-
pytest --cov=pytiled_parser --cov-report=xml --cov-report=html
38-
49+
pytest --cov=pytiled_parser --cov-report=xml --cov-report=html

tests/test_data/world_tests/both/expected.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
),
1515
world.WorldMap(
1616
size=common_types.Size(160, 160),
17-
coordinates=common_types.OrderedPair(0, 0),
17+
coordinates=common_types.OrderedPair(0.0, 0.0),
1818
map_file=Path(Path(__file__).parent / "map_p0-n0.json")
1919
.absolute()
2020
.resolve(),
2121
),
2222
world.WorldMap(
2323
size=common_types.Size(160, 160),
24-
coordinates=common_types.OrderedPair(0, 160),
24+
coordinates=common_types.OrderedPair(0.0, 160.0),
2525
map_file=Path(Path(__file__).parent / "map_p0-n1.json")
2626
.absolute()
2727
.resolve(),

tests/test_data/world_tests/pattern_matched/expected.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
from pathlib import Path
22

3-
from pytiled_parser import common_types, layer, tiled_map, tileset, world
3+
from pytiled_parser import common_types, world
44

55
EXPECTED = world.World(
66
only_show_adjacent=False,
77
maps=[
88
world.WorldMap(
99
size=common_types.Size(160, 160),
10-
coordinates=common_types.OrderedPair(0, 0),
10+
coordinates=common_types.OrderedPair(0.0, 0.0),
1111
map_file=Path(Path(__file__).parent / "map_p0-n0.json")
1212
.absolute()
1313
.resolve(),
1414
),
1515
world.WorldMap(
1616
size=common_types.Size(160, 160),
17-
coordinates=common_types.OrderedPair(0, 160),
17+
coordinates=common_types.OrderedPair(0.0, 160.0),
1818
map_file=Path(Path(__file__).parent / "map_p0-n1.json")
1919
.absolute()
2020
.resolve(),

tests/test_world.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import pytest
77

8-
from pytiled_parser import OrderedPair, world
8+
from pytiled_parser import world
99

1010
TESTS_DIR = Path(os.path.dirname(os.path.abspath(__file__)))
1111
TEST_DATA = TESTS_DIR / "test_data"
@@ -18,16 +18,6 @@
1818
]
1919

2020

21-
def fix_world_map(world_map):
22-
world_map.coordinates = OrderedPair(
23-
round(world_map.coordinates[0], 3), round(world_map.coordinates[1], 3)
24-
)
25-
26-
27-
def fix_world(world):
28-
for world_map in world.maps:
29-
fix_world_map(world_map)
30-
3121
@pytest.mark.parametrize("world_test", ALL_WORLD_TESTS)
3222
def test_world_integration(world_test):
3323
# it's a PITA to import like this, don't do it
@@ -41,6 +31,5 @@ def test_world_integration(world_test):
4131
raw_world_path = world_test / "world.world"
4232

4333
casted_world = world.parse_world(raw_world_path)
44-
fix_world(casted_world)
4534

4635
assert casted_world == expected.EXPECTED

0 commit comments

Comments
 (0)