Skip to content

Commit

Permalink
ci: print different indices
Browse files Browse the repository at this point in the history
  • Loading branch information
loiccoyle committed Sep 21, 2024
1 parent 60499fd commit 581f07c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.9, "3.10", 3.11]
python-version: [3.11]
poetry-version: [1.8.3]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
poetry run pip install --upgrade pip
poetry install --all-extras
- name: Run pytest
run: poetry run pytest -q tests -v
run: poetry run pytest -q tests -v -s
env:
CRYPTOCOMPARE_API_KEY: ${{secrets.CRYPTOCOMPARE_API_KEY}}
GPIOZERO_PIN_FACTORY: mock
Expand Down
8 changes: 5 additions & 3 deletions tests/unit/layouts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ def layout_test(layout_func: LayoutFunc, dimensions, resp, data_dir):
assert out.size == dimensions, f"Wrong dimensions: {filename}"
if UPDATE_REF_PLOTS:
out.save(data_dir / filename)
out_array = np.array(out)
expected_array = np.array(Image.open(data_dir / filename))

print(np.argwhere(out_array != expected_array))
assert (
np.allclose(
np.array(out), np.array(Image.open(data_dir / filename)), rtol=0.01
)
np.allclose(np.array(out), np.array(Image.open(data_dir / filename)))
or UPDATE_REF_PLOTS
), f"Different image: {filename}"

0 comments on commit 581f07c

Please sign in to comment.