From fa1a0ed13ae8be9ae14ab80afb64c70de9f86a24 Mon Sep 17 00:00:00 2001 From: Andreas Holm <60451789+holm10@users.noreply.github.com> Date: Wed, 6 Dec 2023 13:12:55 -0800 Subject: [PATCH] Now copies all files from grid template Necessary to include rate files etc --- pytests/MakeTests.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pytests/MakeTests.py b/pytests/MakeTests.py index 576f713f..19a8f432 100644 --- a/pytests/MakeTests.py +++ b/pytests/MakeTests.py @@ -65,7 +65,7 @@ def make_slab(self): ) def make_unittests(self, outdir, commondir, griddir, inputdir, testfile): - from os import getcwd, chdir, walk + from os import getcwd, chdir, walk, listdir from os.path import abspath, join, exists from pathlib import Path from shutil import copy, copytree, rmtree @@ -116,8 +116,10 @@ def concat_files(file, snippet, header=None): concat_files(join(default, 'input.py'), join(commondir, inputdir, 'header/default.py')) # Add grid data to file, same for all files in inputdir concat_files(join(default, 'input.py'), join(datapath, 'default.py')) - copy(join(datapath, "gridue"), default) - copy(join(datapath, "solution.h5"), default) + for file in listdir(datapath): + # Files to omit + if file not in ['default.py']: + copy(join(datapath, file), default) confpath = join(commondir, 'tests', 'conftest.py') copy(confpath, default) # Loop through all folders containing snippets