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

Fix flaky tests related to data_to_json #6146

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Changes from all commits
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
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