Skip to content

Commit

Permalink
remove outdated if __name__ == "__main__": unittest.main()
Browse files Browse the repository at this point in the history
not needed for pytest
  • Loading branch information
janosh committed Apr 9, 2024
1 parent f956ba8 commit 3fcc340
Show file tree
Hide file tree
Showing 19 changed files with 1 addition and 73 deletions.
4 changes: 0 additions & 4 deletions fireworks/core/tests/test_firework.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,3 @@ def test_iter_len_index(self) -> None:
assert len(wflow) == len(fws)

assert wflow[0] == self.fw1


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/core/tests/test_launchpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,3 @@ def test_many_detours_offline(self) -> None:

launch_full = self.lp.get_launch_by_id(1)
assert len(launch_full.action.detours) == 2000


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/core/tests/test_rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,3 @@ def test_postproc_exception(self) -> None:
fw = self.lp.get_fw_by_id(1)

assert fw.state == "FIZZLED"


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/core/tests/test_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,3 @@ def add_wf(j, dest, tracker, name) -> None:
pwd = os.getcwd()
for ldir in glob.glob(os.path.join(pwd, "launcher_*")):
shutil.rmtree(ldir)


if __name__ == "__main__":
unittest.main()
2 changes: 1 addition & 1 deletion fireworks/scripts/lpad_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ def forget_offline(args: Namespace) -> None:
for f in fw_ids:
lp.forget_offline(f, launch_mode=False)
lp.m_logger.debug(f"Processed fw_id: {f}")
lp.m_logger.info(f"Finished forget_offine, processed {len(fw_ids)} FWs")
lp.m_logger.info(f"Finished forget_offline, processed {len(fw_ids)} FWs")


def report(args: Namespace) -> None:
Expand Down
4 changes: 0 additions & 4 deletions fireworks/tests/master_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,3 @@ def test_recursive_deserialize(self) -> None:
"defuse_children": False,
}
FWAction.from_dict(my_dict)


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/tests/mongo_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,3 @@ def test_stats(self) -> None:
launch_rocket(self.lp, self.fworker)
workflow_results = s.get_workflow_summary(time_field="updated_on")
assert (workflow_results[0]["_id"], workflow_results[0]["count"]) == ("COMPLETED", 3)


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/tests/multiprocessing_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,3 @@ def test_early_exit(self) -> None:
with open(os.path.join(fw3.launches[0].launch_dir, "task.out")) as f:
fw3_text = f.read()
assert fw2_text != fw3_text


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/tests/test_fw_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@ class ConfigTest(unittest.TestCase):
def test_config(self) -> None:
d = config_to_dict()
assert "NEGATIVE_FWID_CTR" not in d


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/user_objects/firetasks/tests/test_dataflow_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,3 @@ def test_import_data_task(self) -> None:
assert "value" in root["temperature"]
assert root["temperature"]["units"] == temperature["units"]
os.remove(filename)


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/user_objects/firetasks/tests/test_fileio_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,3 @@ def test_archive_dir(self) -> None:

def tearDown(self) -> None:
os.chdir(self.cwd)


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/user_objects/firetasks/tests/test_filepad_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,3 @@ def test_addfilesfrompatterntask_run(self) -> None:

def tearDown(self) -> None:
self.fp.reset()


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/user_objects/firetasks/tests/test_script_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,3 @@ def test_task_data_flow(self) -> None:
action = PyTask(**params).run_task(spec)
assert action.update_spec["first"] == 1
assert action.update_spec["second"] == 2


if __name__ == "__main__":
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,3 @@ def test_task(self) -> None:
os.remove("out_template.txt")
if os.path.exists("test_template.txt"):
os.remove("test_template.txt")


if __name__ == "__main__":
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,3 @@ def test_override(self) -> None:

assert p._get_status_cmd("my_name") == ["my_qstatus", "-u", "my_name"]
assert p.q_commands["PBS"]["submit_cmd"] == "my_qsubmit"


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/utilities/tests/test_dagflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,3 @@ def test_dagflow_view(self) -> None:
dagf.to_dot(filename, view="controlflow")
assert os.path.exists(filename)
os.remove(filename)


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/utilities/tests/test_filepad.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,3 @@ def test_update_file_by_id(self) -> None:

def tearDown(self) -> None:
self.fp.reset()


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/utilities/tests/test_fw_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,3 @@ def setUp(self) -> None:

def test_explicit_serialization(self) -> None:
assert load_object(self.s_dict) == self.s_obj


if __name__ == "__main__":
unittest.main()
4 changes: 0 additions & 4 deletions fireworks/utilities/tests/test_update_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,3 @@ def test_update_path(self) -> None:
assert test_doc["foo_list"][1]["foo2"] == "foo/new/path/bar"
test_doc_archived = self.lp.db[f"test_coll_xiv_{datetime.date.today()}"].find_one()
assert test_doc_archived["foo_list"][1]["foo2"] == "foo/old/path/bar"


if __name__ == "__main__":
unittest.main()

0 comments on commit 3fcc340

Please sign in to comment.