diff --git a/src/python/tests/core/compare_core_model.py b/src/python/tests/core/compare_core_model.py index 4d65bfa..b4328df 100644 --- a/src/python/tests/core/compare_core_model.py +++ b/src/python/tests/core/compare_core_model.py @@ -29,6 +29,7 @@ from ensembl.core.models import Base + def check_tables(session: Session, only_table: str = "") -> None: success = [] errors = [] @@ -49,19 +50,20 @@ def check_tables(session: Session, only_table: str = "") -> None: # Show the problematic query and continue logging.warning(f"{table_name}: {err}") errors.append(table_name) - + logging.info(f"{len(success)} tables successfully queried with the ORM") if errors: logging.warning(f"{len(errors)} tables failed to be queried with the ORM: {", ".join(errors)}") else: logging.info("No errors found") + def main() -> None: """Main script entry-point.""" - parser = ArgumentParser( - description=__doc__ + parser = ArgumentParser(description=__doc__) + parser.add_argument( + "--url", required=True, type=str, help="MySQL URL to a core database to get tables data from" ) - parser.add_argument("--url", required=True, type=str, help="MySQL URL to a core database to get tables data from") parser.add_argument("--table", type=str, help="Test this one table only") parser.add_log_arguments(add_log_file=True) args = parser.parse_args() @@ -71,5 +73,6 @@ def main() -> None: with dbc.session_scope() as session: check_tables(session, only_table=args.table) + if __name__ == "__main__": main()