Skip to content

Commit

Permalink
Refactor test_name variable in env_setup_caspt2
Browse files Browse the repository at this point in the history
and env_setup_ivo functions
  • Loading branch information
kohei-noda-qcrg committed Dec 5, 2023
1 parent 8905584 commit 325b52b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ def save(request: pytest.FixtureRequest):
def env_setup_caspt2(request: pytest.FixtureRequest, mpi_num_process: int, omp_num_threads: int, save: bool) -> Tuple[Path, Path, Path, Path, str]:
root_path = Path(__file__).parent.parent
test_path = Path(request.fspath).parent
# test_nameはテストファイル名から拡張子を除いたものから最初のtest_を除いたもの
test_name = os.path.splitext(os.path.basename(request.fspath))[0][5:]
# test_name is the name of the test file without the extension and the first test_.
# (e.g.) /path/to/test/slow/c1_methane_slow/test_c1_methane_slow.py -> c1_methane_slow
test_name = Path(request.fspath).stem[5:]

input_file = "active.inp"
ref_output_file = f"reference.{test_name}.out"
Expand All @@ -78,8 +79,9 @@ def env_setup_caspt2(request: pytest.FixtureRequest, mpi_num_process: int, omp_n
def env_setup_ivo(request: pytest.FixtureRequest, mpi_num_process: int, omp_num_threads: int, save: bool) -> Tuple[Path, Path, Path, Path, str]:
root_path = Path(__file__).parent.parent
test_path = Path(request.fspath).parent
# test_nameはテストファイル名から拡張子を除いたものから最初のtest_を除いたもの
test_name = os.path.splitext(os.path.basename(request.fspath))[0][5:]
# test_name is the name of the test file without the extension and the first test_.
# (e.g.) /path/to/test/dev/ivo_c32h_n2_dev_dirac22/test_ivo_c32h_n2_dev_dirac22.py -> ivo_c32h_n2_dev_dirac22
test_name = Path(request.fspath).stem[5:]

input_file = "active.ivo.inp"
DFPCMONEW_file = "DFPCMONEW"
Expand Down

0 comments on commit 325b52b

Please sign in to comment.