Skip to content

Commit 9ba97e5

Browse files
Copilotyouknowone
andcommitted
chore: move SyntaxError regression test to extra_tests
Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
1 parent 11e9e9c commit 9ba97e5

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

DEVELOPMENT.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ repository's structure:
130130
- `stdlib`: Standard library parts implemented in rust.
131131
- `src`: using the other subcrates to bring rustpython to life.
132132
- `wasm`: Binary crate and resources for WebAssembly build
133-
- `extra_tests`: extra integration test snippets as a supplement to `Lib/test`
133+
- `extra_tests`: extra integration test snippets as a supplement to `Lib/test`.
134+
Add new RustPython-only regression tests here; do not place new tests under `Lib/test`.
134135

135136
## Understanding Internals
136137

Lib/test/test_exceptions.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,14 +2453,6 @@ def test_attributes_old_constructor(self):
24532453
self.assertEqual(error, the_exception.text)
24542454
self.assertEqual("bad bad", the_exception.msg)
24552455

2456-
def test_msg_attribute_writable(self):
2457-
err = SyntaxError("bad bad", ("bad.py", 1, 2, "abcdefg"))
2458-
err.msg = "changed"
2459-
self.assertEqual(err.msg, "changed")
2460-
self.assertEqual(str(err), "changed (bad.py, line 1)")
2461-
del err.msg
2462-
self.assertIsNone(err.msg)
2463-
24642456
@unittest.expectedFailure # TODO: RUSTPYTHON
24652457
def test_incorrect_constructor(self):
24662458
args = ("bad.py", 1, 2)

extra_tests/snippets/builtin_exceptions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ def __init__(self, value):
8585
assert exc.offset is None
8686
assert exc.text is None
8787

88+
err = SyntaxError("bad bad", ("bad.py", 1, 2, "abcdefg"))
89+
err.msg = "changed"
90+
assert err.msg == "changed"
91+
assert str(err) == "changed (bad.py, line 1)"
92+
del err.msg
93+
assert err.msg is None
94+
8895
# Regression to:
8996
# https://github.com/RustPython/RustPython/issues/2779
9097

0 commit comments

Comments
 (0)