diff --git a/Tests/Python/test_matrix_debug_output.py b/Tests/Python/test_matrix_debug_output.py index 5a5e88efca4cdcc66be568889b081c024f222395..b4c7946cf5a752e82f322e22aabc1e5b025115bc 100644 --- a/Tests/Python/test_matrix_debug_output.py +++ b/Tests/Python/test_matrix_debug_output.py @@ -75,6 +75,7 @@ def check_global_matrix_output_files_exist(outdir, file_should_exist=True): for f, num_lines_expected in map_filename_to_num_lines.items(): logfile = outdir / f + print(logfile) assert file_should_exist == logfile.exists() if file_should_exist: @@ -153,7 +154,7 @@ def test_local_matrix_debug_output(monkeypatch, prefix_parameter, elements_param # run and test check_local_matrix_output_files_exist(tmpdirpath, False) - run(prjpath, tmpdirpath, expect_ogs_success) + run(str(prjpath), str(tmpdirpath), expect_ogs_success) if expect_ogs_success: check_simulation_results_exist(tmpdirpath) @@ -194,6 +195,7 @@ def test_global_matrix_debug_output(monkeypatch, prefix_parameter): # https://docs.pytest.org/en/6.2.x/reference.html#pytest.MonkeyPatch with tempfile.TemporaryDirectory() as tmpdirname, monkeypatch.context() as ctx: + tmpdirpath = Path(tmpdirname) # prepare environment if prefix_setting is False: pass @@ -205,11 +207,11 @@ def test_global_matrix_debug_output(monkeypatch, prefix_parameter): ctx.chdir(tmpdirname) # run and test - check_global_matrix_output_files_exist(tmpdirname, False) + check_global_matrix_output_files_exist(tmpdirpath, False) - run(prjpath, tmpdirname, expect_ogs_success) + run(str(prjpath), str(tmpdirpath), expect_ogs_success) if expect_ogs_success: - check_simulation_results_exist(tmpdirname) + check_simulation_results_exist(tmpdirpath) - check_global_matrix_output_files_exist(tmpdirname, prefix_expect_output) + check_global_matrix_output_files_exist(tmpdirpath, prefix_expect_output) diff --git a/Tests/Python/test_ogs_asm_threads.py b/Tests/Python/test_ogs_asm_threads.py index e066d06248dee7e5a4dbecd8d7f4f39f72a8c718..73ece7935e275c16771eb355b3f676c1e0048e96 100644 --- a/Tests/Python/test_ogs_asm_threads.py +++ b/Tests/Python/test_ogs_asm_threads.py @@ -79,7 +79,7 @@ def test_ogs_asm_threads_env_var(monkeypatch, asm_threads_parameter): ctx.chdir(tmpdirname) # run and test - run(prjpath, Path(tmpdirname), expect_ogs_success) + run(str(prjpath), tmpdirname, expect_ogs_success) if expect_ogs_success: check_simulation_results_exist(Path(tmpdirname)) diff --git a/Tests/Python/test_python_bc_simulation.py b/Tests/Python/test_python_bc_simulation.py index 63c158c1ae879239d23b14439a354fe936dbe18e..7ec6bc8a7be63db2b271e60659d1d2fabbad0ec6 100644 --- a/Tests/Python/test_python_bc_simulation.py +++ b/Tests/Python/test_python_bc_simulation.py @@ -12,7 +12,7 @@ def test_HM_ground_equil_TaylorHood_Python(): ) with tempfile.TemporaryDirectory() as tmpdirname: - arguments = ["ogs", prjpath, "-o", tmpdirname] + arguments = ["ogs", str(prjpath), "-o", tmpdirname] try: print("Python OpenGeoSys.init ...") diff --git a/Tests/Python/test_simulator.py b/Tests/Python/test_simulator.py index 2f6f0533204820f0c420d82fb10c90eccb6b2653..0d4ebef436728ffface963ebe5fb9de2d33dd73b 100644 --- a/Tests/Python/test_simulator.py +++ b/Tests/Python/test_simulator.py @@ -5,7 +5,7 @@ import ogs.simulator as sim def test_simulator(): - current_dir = Path(__file__).parent.abspath() + current_dir = Path(__file__).parent.resolve() arguments = [ "", f"{current_dir}/../Data/Parabolic/LiquidFlow/Flux/cube_1e3_calculatesurfaceflux.prj", diff --git a/Tests/Python/test_simulator_mesh_interface.py b/Tests/Python/test_simulator_mesh_interface.py index 61ca3fa73f71b3f386a9985ef33eef442dcfc217..03ae3332f5a63916558e1d1480ef507c06e81c43 100644 --- a/Tests/Python/test_simulator_mesh_interface.py +++ b/Tests/Python/test_simulator_mesh_interface.py @@ -79,7 +79,7 @@ def checkCells(cells, celltypes, points): def test_simulator(): - current_dir = Path(__file__).parent.abspath() + current_dir = Path(__file__).parent.resolve() arguments = [ "", f"{current_dir}/../Data/Parabolic/LiquidFlow/Flux/3D/Hex/cuboid_1x1x1_hex_27_Dirichlet_Dirichlet_Python.prj",