diff --git a/tests/conftest.py b/tests/conftest.py index f6dd861b..af22c9c4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -20,20 +20,21 @@ @pytest.fixture(autouse=True, scope="function") -def amrex_init(): - amr.initialize( - [ - # print AMReX status messages - "amrex.verbose=2", - # throw exceptions and create core dumps instead of - # AMReX backtrace files: allows to attach to - # debuggers - "amrex.throw_exception=1", - "amrex.signal_handling=0", - # abort GPU runs if out-of-memory instead of swapping to host RAM - # "abort_on_out_of_gpu_memory=1", - ] - ) +def amrex_init(tmpdir): + with tmpdir.as_cwd(): + amr.initialize( + [ + # print AMReX status messages + "amrex.verbose=2", + # throw exceptions and create core dumps instead of + # AMReX backtrace files: allows to attach to + # debuggers + "amrex.throw_exception=1", + "amrex.signal_handling=0", + # abort GPU runs if out-of-memory instead of swapping to host RAM + # "abort_on_out_of_gpu_memory=1", + ] + ) yield amr.finalize()