Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] n3fit unit testing #590

Merged
merged 19 commits into from
Nov 7, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions n3fit/src/n3fit/tests/test_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ def test_performfit():
tmp_path = pathlib.Path(tmp_name)
# cp runcard to tmp folder
shutil.copy(QUICKPATH, tmp_path)
os.chdir(tmp_path)
# run the fit
os.environ['KMP_DUPLICATE_LIB_OK'] = 'TRUE'
new_environment = {"KMP_DUPLICATE_LIB_OK": "TRUE", **os.environ}
# The flag KMP_DUPLICATE_LIB_OK is necessary to avoid some errors
# related to the linking of OMP in travis when running under MacOS
sp.run(f"{EXE} {QUICKCARD} {REPLICA}", shell=True)
proc = sp.run(f"{EXE} {QUICKCARD} {REPLICA}", shell=True, env=new_environment, cwd = tmp_path)
assert proc.returncode == 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just add check=True to subprocess.run.

# read up the .fitinfo files
full_path = tmp_path / f"{QUICKNAME}/nnfit/replica_{REPLICA}/{QUICKNAME}.fitinfo"
new_fitinfo = load_data(full_path)
Expand Down