Skip to content

[SPARK-56634][PYTHON][TESTS] Add __main__ block to pyspark.sql.tests.connect.test_session#55560

Draft
zhengruifeng wants to merge 1 commit intoapache:masterfrom
zhengruifeng:pyspark-test-session-main-block
Draft

[SPARK-56634][PYTHON][TESTS] Add __main__ block to pyspark.sql.tests.connect.test_session#55560
zhengruifeng wants to merge 1 commit intoapache:masterfrom
zhengruifeng:pyspark-test-session-main-block

Conversation

@zhengruifeng
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Adds the standard if __name__ == "__main__" block to python/pyspark/sql/tests/connect/test_session.py, matching the convention used by every other test_*.py module in the same directory (e.g., test_connect_basic.py):

if __name__ == "__main__":
    from pyspark.testing import main

    main()

Why are the changes needed?

Without the block, this file cannot be invoked directly via python python/pyspark/sql/tests/connect/test_session.py, unlike its siblings. It is the only test_*.py file under python/pyspark/**/tests/ missing this block.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Pure addition; the appended block is byte-identical to the pattern used by sibling files such as test_connect_basic.py. Verified the module still parses with python -c "import ast; ast.parse(open('python/pyspark/sql/tests/connect/test_session.py').read())".

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (claude-opus-4-7)

@zhengruifeng
Copy link
Copy Markdown
Contributor Author

it seems the test itself cannot pass, mark a draft first

@zhengruifeng zhengruifeng marked this pull request as draft April 27, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants