def test_dagster_home_not_set(): with environ({"DAGSTER_HOME": ""}): with pytest.raises( DagsterInvariantViolationError, match=r"The environment variable \$DAGSTER_HOME is not set\.", ): _dagster_home()
def test_dagster_home_raises(dirname): with environ({"DAGSTER_HOME": dirname}): with pytest.raises( DagsterInvariantViolationError, match="DAGSTER_HOME must be absolute path: {}".format(dirname), ): _dagster_home()
def test_dagster_home_not_abspath(dirname): with environ({"DAGSTER_HOME": dirname}): with pytest.raises( DagsterInvariantViolationError, match=re.escape('$DAGSTER_HOME "{}" must be an absolute path.'.format(dirname)), ): _dagster_home()
def test_dagster_home_not_dir(): dirname = '/this/path/does/not/exist' with environ({'DAGSTER_HOME': dirname}): with pytest.raises( DagsterInvariantViolationError, match='DAGSTER_HOME "{}" is not a folder or does not exist!'.format(dirname), ): _dagster_home()
def test_dagster_home_not_dir(): dirname = "/this/path/does/not/exist" with environ({"DAGSTER_HOME": dirname}): with pytest.raises( DagsterInvariantViolationError, match=re.escape( '$DAGSTER_HOME "{}" is not a directory or does not exist.'. format(dirname)), ): _dagster_home()