Implements lazy initialization of a singleton instance of this class. We cannot initialize the instances when this module is imported because some dependencies may not be available yet, e.g. the pytest config object. Thus we instead initialize it the first time that a test needs it.
(cls, pytest_config=None)
| 282 | |
| 283 | @classmethod |
| 284 | def get_instance(cls, pytest_config=None): |
| 285 | """Implements lazy initialization of a singleton instance of this class. We cannot |
| 286 | initialize the instances when this module is imported because some dependencies may |
| 287 | not be available yet, e.g. the pytest config object. Thus we instead initialize it |
| 288 | the first time that a test needs it.""" |
| 289 | if cls._instance is not None: |
| 290 | return cls._instance |
| 291 | |
| 292 | assert pytest_config is not None, ( |
| 293 | "Initial pytest_config must be provided for singleton") |
| 294 | cls._instance = cls.create_new_instance(pytest_config) |
| 295 | return cls._instance |
| 296 | |
| 297 | @property |
| 298 | def build_flavor(self): |