Skip to content

Commit 2049351

Browse files
committed
moved fixture to respective module
1 parent 2330ec1 commit 2049351

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

tests/integration/conftest.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import logging
32

43
from pytest import fixture
@@ -21,8 +20,4 @@ def product_info():
2120
return 'pytester', __version__
2221

2322

24-
@fixture
25-
def serverless_env():
26-
os.environ['DATABRICKS_SERVERLESS_COMPUTE_ID'] = 'auto'
27-
yield
28-
os.environ.pop('DATABRICKS_SERVERLESS_COMPUTE_ID')
23+
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1+
import os
2+
from pytest import fixture
3+
4+
15
def test_databricks_connect(spark):
26
rows = spark.sql("SELECT 1").collect()
37
assert rows[0][0] == 1
48

59

6-
def test_databricks_connect_serverless(serverless_env, spark) -> None:
10+
@fixture
11+
def serverless_env():
12+
os.environ['DATABRICKS_SERVERLESS_COMPUTE_ID'] = 'auto'
13+
yield
14+
os.environ.pop('DATABRICKS_SERVERLESS_COMPUTE_ID')
15+
16+
17+
def test_databricks_connect_serverless(serverless_env, spark):
718
rows = spark.sql("SELECT 1").collect()
819
assert rows[0][0] == 1

0 commit comments

Comments
 (0)