From 5d481e29607bc8a479d63cac35512bc080d56b89 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Thu, 17 Sep 2026 14:10:25 -0700 Subject: [PATCH] Ruff: Fixed SIM115 --- pyproject.toml | 2 +- tests/test_rf64.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9fcc3c4..3c087fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,7 @@ fixable = ['ALL'] ignore = [ 'FA100', #Add `from __future__ import annotations` to simplify `typing.Optional` 'UP022', # Prefer `capture_output` over sending `stdout` and `stderr` to `PIPE` - 'SIM115', # Use a context manager for opening files + # 'SIM115', # Use a context manager for opening files 'UP031', #Use format specifiers instead of percent format # 'C408', # Unnecessary `dict()` call (rewrite as a literal) # 'C417' # Unnecessary `map()` usage (rewrite using a generator expression) diff --git a/tests/test_rf64.py b/tests/test_rf64.py index abca12e..9046ea8 100644 --- a/tests/test_rf64.py +++ b/tests/test_rf64.py @@ -15,8 +15,6 @@ class TestRf64(TestCase): def test_open(self): for path in glob("tests/test_files/rf64/*.wav.gz"): - gz = gzip.open(path) - wav_info = wavinfo.WavInfoReader(gz) - - self.assertIsNotNone(wav_info) - # self.assertIsNotNone(wav_info.bext) + with gzip.open(path) as gz: + wav_info = wavinfo.WavInfoReader(gz) + self.assertIsNotNone(wav_info)