diff --git a/compliance_checker/tests/helpers.py b/compliance_checker/tests/helpers.py index 40a9ea87..78b4649c 100644 --- a/compliance_checker/tests/helpers.py +++ b/compliance_checker/tests/helpers.py @@ -1,6 +1,6 @@ import tempfile -from netCDF4 import Dataset +from netCDF4._netCDF4 import Dataset class MockNetCDF(Dataset): @@ -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): """