Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: move SyntaxError regression test to extra_tests
Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
  • Loading branch information
Copilot and youknowone committed Dec 24, 2025
commit 9ba97e52ef70e2c54024a6b51de8a2a456d727bf
3 changes: 2 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ repository's structure:
- `stdlib`: Standard library parts implemented in rust.
- `src`: using the other subcrates to bring rustpython to life.
- `wasm`: Binary crate and resources for WebAssembly build
- `extra_tests`: extra integration test snippets as a supplement to `Lib/test`
- `extra_tests`: extra integration test snippets as a supplement to `Lib/test`.
Add new RustPython-only regression tests here; do not place new tests under `Lib/test`.

## Understanding Internals

Expand Down
8 changes: 0 additions & 8 deletions Lib/test/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2453,14 +2453,6 @@ def test_attributes_old_constructor(self):
self.assertEqual(error, the_exception.text)
self.assertEqual("bad bad", the_exception.msg)

def test_msg_attribute_writable(self):
err = SyntaxError("bad bad", ("bad.py", 1, 2, "abcdefg"))
err.msg = "changed"
self.assertEqual(err.msg, "changed")
self.assertEqual(str(err), "changed (bad.py, line 1)")
del err.msg
self.assertIsNone(err.msg)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_incorrect_constructor(self):
args = ("bad.py", 1, 2)
Expand Down
7 changes: 7 additions & 0 deletions extra_tests/snippets/builtin_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ def __init__(self, value):
assert exc.offset is None
assert exc.text is None

err = SyntaxError("bad bad", ("bad.py", 1, 2, "abcdefg"))
err.msg = "changed"
assert err.msg == "changed"
assert str(err) == "changed (bad.py, line 1)"
del err.msg
assert err.msg is None

# Regression to:
# https://github.com/RustPython/RustPython/issues/2779

Expand Down
Loading