From 9510ec44c0a3c308f8a66ded03fbe9a39dc4611c Mon Sep 17 00:00:00 2001 From: Bryan Brancotte <bryan.brancotte@pasteur.fr> Date: Wed, 3 Apr 2024 15:55:48 +0200 Subject: [PATCH] De-factorize test declaration --- jass/test/test_init_table.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/jass/test/test_init_table.py b/jass/test/test_init_table.py index 3d7b0ef7..bb400510 100644 --- a/jass/test/test_init_table.py +++ b/jass/test/test_init_table.py @@ -12,7 +12,7 @@ from . import JassTestCase class TestInitTable(object): - + test_folder = "data_real" __test__ = False def setUp(self): @@ -69,16 +69,13 @@ class TestInitTable(object): assert_frame_equal(self.expected_cov, self.result_cov, check_like=True) -params = [("nonans", "data_real", True), ("withnans", "data_real", False)] +class TestInitTableNoNans(TestInitTable, JassTestCase): + computed_cov = True + + +class TestInitTableWithNans(TestInitTable, JassTestCase): + computed_cov = False -for name, param, computed_cov in params: - cls_name = "TestInitTable_%s" % (name,) - print(cls_name) - globals()[cls_name] = type( - cls_name, - (TestInitTable, JassTestCase), - {"test_folder": param, "computed_cov":computed_cov, "__test__": True}, - ) if __name__ == "__main__": import unittest -- GitLab