You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The game-related functions can be placed into a file called game.py, which could be imported such that all previous calls to game.clan, game.switches etc. are all still functional without changes.
This would also (hopefully) mean that our tests can actually access things in game, or at least that we can write a pipeline function to build game and make it available to them. This should remove the confusing overhead we have of code intentionally taking a different route when running in tests (which is explicitly the opposite of what tests should do!).
Description
Game
(the class) andgame
(the object we call) don't need to exist the way they do. The Pythonic way of doing a singleton is through the Global Object Pattern. Related justification for why Singletons aren't used in Python.The game-related functions can be placed into a file called
game.py
, which could be imported such that all previous calls togame.clan
,game.switches
etc. are all still functional without changes.This would also (hopefully) mean that our tests can actually access things in
game
, or at least that we can write a pipeline function to buildgame
and make it available to them. This should remove the confusing overhead we have of code intentionally taking a different route when running in tests (which is explicitly the opposite of what tests should do!).This is tangentially related to #2515.
Requirements:
MUST
class Game
andgame = Game()
game
elsewhere in code; i.e., ensure functionality is accessed in the exact same way as beforeThe text was updated successfully, but these errors were encountered: