Skip to content

Commit

Permalink
change the mocked method
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyinz committed Jan 9, 2025
1 parent ec6769c commit e0cc49a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions python/mspasspy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@ def __init__(
.master(self._spark_master_url)
.getOrCreate()
)
print("DEBUG====================")
print(spark.sparkContext.parallelize([1, 2, 3, 4, 5]).collect())
print(spark)
print(spark.sparkContext)
print("DEBUG END================")
self._spark_context = spark.sparkContext
except Exception as err:
raise MsPASSError(
Expand Down
4 changes: 2 additions & 2 deletions python/tests/test_mspass_client_spark_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_spark_scheduler(self, monkeypatch):
monkeypatch.setenv("MSPASS_SCHEDULER", "spark")
monkeypatch.setenv("MSPASS_SCHEDULER_ADDRESS", "168.0.0.1")
monkeypatch.setenv("SPARK_MASTER_PORT", "12345")
monkeypatch.setattr(SparkSession.builder, "appName", mock_excpt)
monkeypatch.setattr(SparkSession, "builder", mock_excpt)
with pytest.raises(
MsPASSError,
match="Runntime error: cannot create a spark configuration with: spark://168.0.0.1:12345",
Expand Down Expand Up @@ -257,7 +257,7 @@ def test_set_scheduler(self, monkeypatch):
assert self.client._dask_client == temp_dask_client

# test set spark, previous is dask
monkeypatch.setattr(SparkSession.builder, "config", mock_excpt)
monkeypatch.setattr(SparkSession, "builder", mock_excpt)
with pytest.raises(
MsPASSError,
match="Runntime error: cannot create a spark configuration with: spark://168.1.2.3:7077",
Expand Down

0 comments on commit e0cc49a

Please sign in to comment.