mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-08 11:24:49 -08:00
Python: Make code testable
Avoid executing code on module level as this prevents importing the module for testing. Especially infinite loops are evil.
This commit is contained in:
@@ -353,4 +353,5 @@ class Basketball:
|
||||
self.opponent_jumpshot()
|
||||
|
||||
|
||||
new_game = Basketball()
|
||||
if __name__ == "__main__":
|
||||
Basketball()
|
||||
|
||||
Reference in New Issue
Block a user