Skip to content

test: adopt pytest.raises idiom for E11 error test #264

Description

@dean0x

Location: crates/mds-python/tests/test_errors.py:246

What: E11 uses try/except/else + pytest.fail rather than pytest.raises, which is less idiomatic in pytest.

Why deferred: Test style improvement, no functional change. Better addressed as part of broader test idiom standardization.

Source review: .devflow/docs/reviews/fix-esc-injection-176/2026-07-25_1625 (python-8)

Current pattern:
```python
try:
# code that should raise
except SomeException:
# handle expected case
else:
pytest.fail("Expected exception not raised")
```

Idiomatic pytest pattern:
```python
with pytest.raises(SomeException):
# code that should raise
```

Acceptance Criteria:

  • Convert E11 to use pytest.raises context manager
  • Audit other test files for similar patterns
  • Verify test continues to pass
  • Conditioned on broader file-wide style migration (to avoid isolated idiom pockets)

Note: This is a low-priority style cleanup; the test functions correctly as-is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    javascriptPull requests that update javascript code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions