Closed clint-lawrence closed 2 months ago
@josh-marshall-amp the github diff makes it hard to review, but nothing has changed between main.py and main.py other than removing the if __name__ == "__main__"
block from the bottom.
TIL - you can diff a renamed file across two branches:
> git diff master:./__main__.py ./main.py
diff --git a/src/fixate/__main__.py b/src/fixate/main.py
index f446c2c..d5db95a 100644
--- a/src/fixate/__main__.py
+++ b/src/fixate/main.py
@@ -424,8 +424,3 @@ def run_main_program(test_script_path=None, main_args=None):
# Could this be replaced with a simple log_file variable in fixate.config ^ ?
supervisor = FixateSupervisor(test_script_path, args)
exit(supervisor.run_fixate())
-
-
-# Setup configuration
-if __name__ == "__main__":
- run_main_program()
Because we were importing
__main__
in__init__
, we ended up with a warning that__main__
was already imported when it was executed as main. Moving the previous contents of__main__.py
tomain.py
so that it can then be import in__init__.py
and__main__.py
fixes that.