Skip to content

Commit

Permalink
iMultiFab Unit Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Jan 29, 2025
1 parent 27b9c5e commit 30624df
Show file tree
Hide file tree
Showing 2 changed files with 504 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,21 @@ def __exit__(self, exc_type, exc_value, traceback):

with MfabDeviceContextManager() as mfab:
yield mfab


@pytest.fixture(scope="function", params=list(itertools.product([1, 3], [0, 1])))
def imfab(boxarr, distmap, request):
class iMfabContextManager:
def __enter__(self):
num_components = request.param[0]
num_ghost = request.param[1]
self.imfab = amr.iMultiFab(boxarr, distmap, num_components, num_ghost)
self.imfab.set_val(0, 0, num_components)
return self.imfab

def __exit__(self, exc_type, exc_value, traceback):
self.imfab.clear()
del self.imfab

with iMfabContextManager() as imfab:
yield imfab
Loading

0 comments on commit 30624df

Please sign in to comment.