Skip to content

fix(pytest): preserve node separators inside parameter IDs - #1411

Draft
Kayvan-Zahiri wants to merge 1 commit into
cloudbees-oss:mainfrom
Kayvan-Zahiri:codex/preserve-pytest-parameter-separators
Draft

Kayvan-Zahiri wants to merge 1 commit into
cloudbees-oss:mainfrom
Kayvan-Zahiri:codex/preserve-pytest-parameter-separators

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

Pytest parameter IDs can contain ::. Splitting the full node ID on every separator treats those parameter contents as class/test delimiters. For example, tests/test_mod.py::TestClass::test_value[left::right] loses the class and records the testcase as right]. This affects both subset requests and pytest-reportlog imports.

Split the file path first, then split only the qualified test name before the parameter suffix. Preserve the complete suffix, including additional brackets and separators. Existing file, class, and unparameterized handling stays unchanged.

Four regressions fail before the fix: function parameters, class parameters with multiple separators/brackets, the mocked public subset pytest CLI request, and a JSON report import. Added a control for brackets in the file path.

Validation using the locked development environment, Python 3.13:

  • All 532 Python unittest tests pass with localhost server access. The initial restricted run had three socket-permission errors; the complete rerun passes.
  • Repository-wide configured Flake8: zero findings.
  • MyPy: no issues in 202 source files.
  • Source distribution and wheel build successfully.
  • Changed-file isort/autopep8 checks and git diff --check pass.
  • Generated CLI reference is byte-identical to the checked-in reference.

Tests use local report files and mocked HTTP/local servers; no hosted report upload or credentials used. Java/Bazel tests and the Windows/Linux matrix were not run. Developed with Codex assistance and verified locally.

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.

1 participant