def _assert_only_test_databases_accessed(self):
        original_init = Database.__init__
        self_ = self

        def asserting_init(self, uri, create=False, server=None, **params):
            original_init(self, uri, create=create, server=server, **params)
            try:
                self_._assert_is_a_test_db(self.dbname)
            except __HOLE__:
                db = self

                def request(self, *args, **kwargs):
                    self_._assert_is_a_test_db(db.dbname)

                self.res.request = request

        Database.__init__ = asserting_init
dataset/ETHPy150Open dimagi/commcare-hq/testrunner.py/HqTestSuiteRunner._assert_only_test_databases_accessed