Skip to content

Commit

Permalink
Fix flaky tests related to data_to_json
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Sep 22, 2023
1 parent 7d9af3d commit 1017487
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tests/unit_tests/config/test_forward_model_data_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ def joblist():
return result


# Keywords for the ext_job initialization file
#
ext_job_keywords = [
"MAX_RUNNING",
"STDIN",
Expand All @@ -97,9 +95,6 @@ def joblist():
"MAX_RUNNING_MINUTES",
]

#
# JSON keywords
#
json_keywords = [
"name",
"executable",
Expand Down Expand Up @@ -167,11 +162,7 @@ def _generate_job(
mode |= stat.S_IXUSR | stat.S_IXGRP
os.chmod(executable, stat.S_IMODE(mode))

ext_job = ExtJob.from_config_file(config_file, name)
os.unlink(config_file)
os.unlink(executable)

return ext_job
return ExtJob.from_config_file(config_file, name)


def empty_list_if_none(_list):
Expand Down Expand Up @@ -360,6 +351,7 @@ def test_transfer_arg_types():
]


@pytest.mark.usefixtures("use_tmpdir")
def test_one_job(joblist):
for i, job in enumerate(joblist):
run_id = "test_one_job"
Expand All @@ -384,6 +376,7 @@ def run_all(joblist):
verify_json_dump(joblist, data, range(len(joblist)), run_id)


@pytest.mark.usefixtures("use_tmpdir")
def test_all_jobs(joblist):
run_all(joblist)

Expand Down

0 comments on commit 1017487

Please sign in to comment.