Skip to content

Commit

Permalink
Set CWD of runner
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Aug 29, 2023
1 parent 7457cf7 commit efe73b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions tests/python/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-

import os

import pytest

import amrex.space3d as amr
Expand All @@ -12,6 +14,9 @@
else:
print("NO mpi4py load")

# base path for input files
basepath = os.getcwd()


@pytest.fixture(autouse=True, scope="function")
def amrex_init(tmpdir):
Expand Down
4 changes: 3 additions & 1 deletion tests/python/test_charge_deposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import amrex.space3d as amr
import impactx

from conftest import basepath


def test_charge_deposition(save_png=True):
"""
Expand All @@ -24,7 +26,7 @@ def test_charge_deposition(save_png=True):
sim = impactx.ImpactX()

sim.n_cell = [16, 24, 32]
sim.load_inputs_file("examples/fodo/input_fodo.in")
sim.load_inputs_file(basepath + "/examples/fodo/input_fodo.in")
sim.space_charge = True
sim.slice_step_diagnostics = False

Expand Down
6 changes: 4 additions & 2 deletions tests/python/test_impactx.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
import amrex.space3d as amr
from impactx import ImpactX, RefPart, distribution, elements

from conftest import basepath


def test_impactx_fodo_file():
"""
This tests an equivalent to main.cpp in C++
"""
sim = ImpactX()

sim.load_inputs_file("examples/fodo/input_fodo.in")
sim.load_inputs_file(basepath + "/examples/fodo/input_fodo.in")

sim.init_grids()
sim.init_beam_distribution_from_inputs()
Expand Down Expand Up @@ -221,7 +223,7 @@ def test_impactx_no_elements():
"""
sim = ImpactX()

sim.load_inputs_file("examples/fodo/input_fodo.in")
sim.load_inputs_file(basepath + "/examples/fodo/input_fodo.in")

sim.init_grids()
sim.init_beam_distribution_from_inputs()
Expand Down

0 comments on commit efe73b8

Please sign in to comment.