Skip to content

Commit

Permalink
fix: pytest deprecation warning (#42)
Browse files Browse the repository at this point in the history
* fix: pytest deprecation warning

* gha: change macos-11 to macos-latest
  • Loading branch information
fdintino authored Feb 7, 2024
1 parent ec6a156 commit 0864e2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
matrix:
os: [
"ubuntu-20.04",
"macos-11",
"macos-latest",
]
python-version: [
"pypy-3.7",
Expand All @@ -34,11 +34,11 @@ jobs:
# Include new variables for Codecov
- os: ubuntu-20.04
codecov-flag: GHA_Ubuntu
- os: macos-11
- os: macos-latest
codecov-flag: GHA_macOS
exclude:
- python-version: "2.7"
os: "macos-11"
os: "macos-latest"

runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }} (libavif ${{ matrix.libavif-version }})
Expand Down
5 changes: 4 additions & 1 deletion tests/test_file_avif.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import xml.etree.ElementTree
from contextlib import contextmanager
from io import BytesIO
import warnings

try:
from os import cpu_count
Expand Down Expand Up @@ -199,7 +200,9 @@ def test_accept_ftyp_brands(self, major_brand):
def test_no_resource_warning(self, tmp_path):
with Image.open(TEST_AVIF_FILE) as image:
temp_file = str(tmp_path / "temp.avif")
pytest.warns(None, image.save, temp_file)
with warnings.catch_warnings():
warnings.simplefilter("error")
image.save(temp_file)

def test_file_pointer_could_be_reused(self):
with open(TEST_AVIF_FILE, "rb") as blob:
Expand Down

0 comments on commit 0864e2c

Please sign in to comment.