Skip to content

refactor(python): split binding tests by category#1304

Merged
chaliy merged 3 commits intomainfrom
fix/issue-1259-python-test-layout
Apr 15, 2026
Merged

refactor(python): split binding tests by category#1304
chaliy merged 3 commits intomainfrom
fix/issue-1259-python-test-layout

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 15, 2026

Summary

Closes #1259.

What

  • split the monolithic Python binding test layout into public category modules that mirror the Node suite names
  • renamed test_frameworks.py to test_ai_adapters.py
  • exposed a single public test_security.py module for the merged security suite

Why

  • align the Python test layout with the Node parity plan
  • make follow-up issues that add coverage (#1260, #1262) land in the right files without reworking the suite again

How

  • moved the existing monolithic test implementations into hidden source modules inside crates/bashkit-python/tests/
  • added package-backed public category files (test_basic.py, test_vfs.py, test_tool_metadata.py, etc.) that re-export the existing tests from those hidden modules
  • kept the security split readable internally while collecting it through one public test_security.py

Verification

  • source .venv312/bin/activate && ruff check tests
  • source .venv312/bin/activate && ruff format --check tests
  • source .venv312/bin/activate && pytest tests --collect-only -q (427 tests collected)
  • source .venv312/bin/activate && pytest tests/test_ai_adapters.py tests/test_basic.py tests/test_builtins.py tests/test_control_flow.py tests/test_error_handling.py tests/test_scripts.py tests/test_strings_and_quoting.py tests/test_tool_metadata.py tests/test_vfs.py tests/test_security.py -q (327 passed)
  • just pre-pr is not green on this macOS machine because spec_tests compares Bashkit against the local BSD/GNU userland mix and bash_comparison_tests reports existing parity mismatches unrelated to this refactor
  • source .venv312/bin/activate && pytest tests -q still crashes in the unchanged tests/test_python_security.py::TestResourceLimits::test_fork_bomb_blocked on this machine; the touched files themselves pass

@chaliy chaliy merged commit 5803bb7 into main Apr 15, 2026
18 checks passed
@chaliy chaliy deleted the fix/issue-1259-python-test-layout branch April 15, 2026 03:36
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.

refactor(python): restructure tests to mirror Node test file layout

1 participant