tests/functional/configuration/test_all_options.py
def check_env_var_config(self, tmp_path, monkeypatch):
        """Check that env vars overrides global configuration"""
        update_singletons()

        assert orion.core.config.storage.to_dict() == {
            "type": self.env_vars["ORION_STORAGE_TYPE"],
            "database": {
                "name": self.env_vars["ORION_DB_NAME"],
                "type": self.env_vars["ORION_DB_TYPE"],
                "host": self.env_vars["ORION_DB_ADDRESS"],
                "port": int(self.env_vars["ORION_DB_PORT"]),
            },
        }

        with pytest.raises(SingletonNotInstantiatedError):
            get_storage()

        command = f"hunt --exp-max-trials 0 -n test python {script} -x~uniform(0,1)"
        orion.core.cli.main(command.split(" "))

        storage = get_storage()
        assert isinstance(storage, Legacy)
        assert isinstance(storage._db, PickledDB)
        assert storage._db.host == self.env_vars["ORION_DB_ADDRESS"]
Check that env vars overrides global configuration
Check that env vars overrides global configuration
Check that env vars overrides global configuration
def check_env_var_config(self, tmp_path, monkeypatch):
        update_singletons()
        assert orion.core.config.storage.to_dict() == {
            "type": self.env_vars["ORION_STORAGE_TYPE"],
            "database": {
                "name": self.env_vars["ORION_DB_NAME"],
                "type": self.env_vars["ORION_DB_TYPE"],
                "host": self.env_vars["ORION_DB_ADDRESS"],
                "port": int(self.env_vars["ORION_DB_PORT"]),
            },
        }
        with pytest.raises(SingletonNotInstantiatedError):
            get_storage()
        command = f"hunt --exp-max-trials 0 -n test python {script} -x~uniform(0,1)"
        orion.core.cli.main(command.split(" "))
        storage = get_storage()
        assert isinstance(storage, Legacy)
        assert isinstance(storage._db, PickledDB)
        assert storage._db.host == self.env_vars["ORION_DB_ADDRESS"]
def check_env_var_config ( self , tmp_path , monkeypatch ) : update_singletons ( ) assert orion . core . config . storage . to_dict ( ) == { "type" : self . env_vars [ "ORION_STORAGE_TYPE" ] , "database" : { "name" : self . env_vars [ "ORION_DB_NAME" ] , "type" : self . env_vars [ "ORION_DB_TYPE" ] , "host" : self . env_vars [ "ORION_DB_ADDRESS" ] , "port" : int ( self . env_vars [ "ORION_DB_PORT" ] ) , } , } with pytest . raises ( SingletonNotInstantiatedError ) : get_storage ( ) command = f"hunt --exp-max-trials 0 -n test python {script} -x~uniform(0,1)" orion . core . cli . main ( command . split ( " " ) ) storage = get_storage ( ) assert isinstance ( storage , Legacy ) assert isinstance ( storage . _db , PickledDB ) assert storage . _db . host == self . env_vars [ "ORION_DB_ADDRESS" ]
Check that env vars overrides global configuration
Check that env vars overrides global configuration
"""Check that env vars overrides global configuration"""
self
tmp_path
monkeypatch