Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def _loader(filename: str):
def _enable_fallback_compute():
"""Enable serverless compute if no compute is specified."""
conf = WorkspaceClient().config
if conf.serverless_compute_id or conf.cluster_id or os.environ.get("SPARK_REMOTE"):
has_serverles_compute_id = hasattr(conf, "serverless_compute_id") and conf.serverless_compute_id
if has_serverles_compute_id or conf.cluster_id or os.environ.get("SPARK_REMOTE"):
return

url = "https://docs.databricks.com/dev-tools/databricks-connect/cluster-config"
Expand All @@ -83,6 +84,8 @@ def _allow_stderr_output(config: pytest.Config):
def pytest_configure(config: pytest.Config):
"""Configure pytest session."""
with _allow_stderr_output(config):
src_path = pathlib.Path(__file__).parent.parent / "src"
sys.path.insert(0, str(src_path))
_enable_fallback_compute()

# Initialize Spark session eagerly, so it is available even when
Expand Down