Skip to content

Commit

Permalink
Suppress MockNetCDF __dealloc__ exceptions rather than overriding
Browse files Browse the repository at this point in the history
  • Loading branch information
benjwadams committed Apr 16, 2024
1 parent 2a6196a commit 76b4eb6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions compliance_checker/tests/helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import tempfile

from netCDF4 import Dataset
from netCDF4._netCDF4 import Dataset


class MockNetCDF(Dataset):
Expand All @@ -26,7 +26,10 @@ def __init__(self, filename=None):
# suppress usual dealloc routine to prevent caught exception messages
# from printing
def __dealloc__(self):
pass
try:
super().__dealloc__()
except AttributeError:
pass

class MockTimeSeries(MockNetCDF):
"""
Expand Down

0 comments on commit 76b4eb6

Please sign in to comment.