Skip to content

Commit 66cf3de

Browse files
committed
fix failing tests
1 parent 8c3751a commit 66cf3de

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/spark_config_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,9 @@ def mock_spark_srv_conf_file_with_jira_disabled(self, tmpdir, monkeypatch):
17531753
(None, None), # Invalid: None value
17541754
],
17551755
)
1756-
def test_get_valid_jira_ticket(self, jira_ticket, expected_result, mock_log):
1756+
def test_get_valid_jira_ticket(
1757+
self, jira_ticket, expected_result, mock_log, mock_spark_srv_conf_file_with_jira_disabled,
1758+
):
17571759
"""Test the _get_valid_jira_ticket method with various inputs."""
17581760
spark_conf_builder = spark_config.SparkConfBuilder()
17591761
result = spark_conf_builder._get_valid_jira_ticket(jira_ticket)

tests/utils_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ def test_get_spark_driver_memory_overhead_mb(spark_conf, expected_mem_overhead):
154154

155155
@pytest.fixture
156156
def mock_runtimeenv():
157+
# Clear the lru_cache before applying the mock
158+
utils.get_runtime_env.cache_clear()
157159
with patch('builtins.open', mock_open(read_data=MOCK_ENV_NAME)) as m:
158160
yield m
159161

0 commit comments

Comments
 (0)