diff --git a/fink_grb/distribution/distribution.py b/fink_grb/distribution/distribution.py index 19e1448b3..df7006cf2 100644 --- a/fink_grb/distribution/distribution.py +++ b/fink_grb/distribution/distribution.py @@ -61,7 +61,7 @@ def grb_distribution( >>> grb_distribution( ... ztfxgcn_test, ... "20230101", - ... 10, 40, + ... 30, 40, ... "localhost:9092", ... "toto", "tata" ... ) @@ -207,7 +207,7 @@ def launch_distribution(arguments): >>> launch_distribution({ ... "--config" : "fink_grb/conf/distribute_for_test.conf", ... "--night" : "20230101", - ... "--exit_after" : 10 + ... "--exit_after" : 30 ... }) >>> consumer = AlertConsumer(topics, myconfig) diff --git a/fink_grb/gcn_stream/gcn_reader.py b/fink_grb/gcn_stream/gcn_reader.py index 5cfe63cf0..b41753c8c 100644 --- a/fink_grb/gcn_stream/gcn_reader.py +++ b/fink_grb/gcn_stream/gcn_reader.py @@ -73,17 +73,3 @@ def load_voevent_from_file(file: io.BufferedReader, verbose:bool = False) -> Obj "failed to load the voevent:\n\tlocation={}\n\tcause={}".format(file, e) ) raise e - - -if __name__ == "__main__": # pragma: no cover - import sys - import doctest - from pandas.testing import assert_frame_equal # noqa: F401 - import shutil # noqa: F401 - import io # noqa: F401 - - if "unittest.util" in __import__("sys").modules: - # Show full diff in self.assertEqual. - __import__("sys").modules["unittest.util"]._MAX_LENGTH = 999999999 - - sys.exit(doctest.testmod()[0]) diff --git a/fink_grb/gcn_stream/gcn_stream.py b/fink_grb/gcn_stream/gcn_stream.py index c2a94c7a4..6997ff36f 100644 --- a/fink_grb/gcn_stream/gcn_stream.py +++ b/fink_grb/gcn_stream/gcn_stream.py @@ -200,17 +200,3 @@ def start_gcn_stream(arguments): load_and_parse_gcn(value, gcn_rawdatapath, logger, logs, gcn_fs=gcn_fs) consumer.commit(gcn) - - -# if __name__ == "__main__": # pragma: no cover -# import sys -# import doctest -# from pandas.testing import assert_frame_equal # noqa: F401 -# import pandas as pd # noqa: F401 -# import shutil # noqa: F401 - -# if "unittest.util" in __import__("sys").modules: -# # Show full diff in self.assertEqual. -# __import__("sys").modules["unittest.util"]._MAX_LENGTH = 999999999 - -# sys.exit(doctest.testmod()[0]) diff --git a/fink_grb/utils/fun_utils.py b/fink_grb/utils/fun_utils.py index b6b75abf5..fb1b0c580 100644 --- a/fink_grb/utils/fun_utils.py +++ b/fink_grb/utils/fun_utils.py @@ -1015,23 +1015,3 @@ def read_grb_admin_options(arguments, config, logger, is_test=False): password_writer, ) - -if __name__ == "__main__": # pragma: no cover - import doctest # noqa: F401 - from pandas.testing import assert_frame_equal # noqa: F401 - import pandas as pd # noqa: F401 - import shutil # noqa: F401 - from fink_grb.init import get_config, init_logging # noqa: F401 - from fink_utils.spark.utils import concat_col # noqa: F401 - - from fink_utils.test.tester import spark_unit_tests_science - - globs = globals() - - path_data_fid_1 = "fink_grb/test/test_data/ztf_alert_samples_fid_1.parquet" - path_data_fid_2 = "fink_grb/test/test_data/ztf_alert_samples_fid_2.parquet" - globs["data_fid_1"] = path_data_fid_1 - globs["data_fid_2"] = path_data_fid_2 - - # Run the test suite - spark_unit_tests_science(globs) diff --git a/fink_grb/utils/grb_prob.py b/fink_grb/utils/grb_prob.py index ee864a8b5..e37c95a60 100644 --- a/fink_grb/utils/grb_prob.py +++ b/fink_grb/utils/grb_prob.py @@ -239,17 +239,3 @@ def grb_assoc( return pd.Series(grb_proba) - -if __name__ == "__main__": # pragma: no cover - import pandas as pd # noqa: F401 - from math import sqrt # noqa: F401 - from scipy import special # noqa: F401 - from fink_utils.test.tester import spark_unit_tests_science - from pandas.testing import assert_frame_equal # noqa: F401 - - globs = globals() - - join_data = "fink_grb/test/test_data/join_raw_datatest.parquet" - - # Run the test suite - spark_unit_tests_science(globs)