我的檔案夾結構如下 /test
----test_abc.py
----test_bcd.py
----test_cde.py
----conftest.py
conftest.py 包含所有火花啟動項,在每個 pytest 檔案中,我使用這些裝置。
為了執行所有 pytest 檔案,我正在撰寫一個 shell 腳本,它將呼叫所有測驗,如下所示。這是正確的方法嗎?我想如果我如下單獨呼叫這些檔案,它會在我每次執行時啟動一個新的火花會話。我的假設是否正確,我可以對所有 pytest 使用相同的 spark 會話嗎?
腳本檔案
pytest ./tests/test_abc.py --emr
pytest ./tests/test_bcd.py --emr
pytest ./tests/test_cde.py --emr
uj5u.com熱心網友回復:
如果您想創建一個 pytest 會話但只呼叫幾個檔案,您可以將它們作為位置引數傳遞給 pytest:
pytest ./tests/test_abc.py ./tests/test_bcd.py ./tests/test_cde.py --emr
這樣,會話范圍的固定裝置將只創建一次。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/494568.html
標籤:阿帕奇火花 pyspark apache-spark-sql pytest
