aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2021-03-02 08:17:15 +0200
committerMatti Picus <matti.picus@gmail.com>2021-03-02 08:17:15 +0200
commitfff0a53f1f5e1a087c05f5de9655fb8b90601a34 (patch)
tree538f4056b15fc62a599ae7bd29ffd8de1401df76 /pypy/module/sys/test/test_sysmodule.py
parentdocument branch (diff)
downloadpypy-fff0a53f1f5e1a087c05f5de9655fb8b90601a34.tar.gz
pypy-fff0a53f1f5e1a087c05f5de9655fb8b90601a34.tar.bz2
pypy-fff0a53f1f5e1a087c05f5de9655fb8b90601a34.zip
fix structseq attribute setter error message
Diffstat (limited to 'pypy/module/sys/test/test_sysmodule.py')
-rw-r--r--pypy/module/sys/test/test_sysmodule.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pypy/module/sys/test/test_sysmodule.py b/pypy/module/sys/test/test_sysmodule.py
index cf0812ae93..2a8d70f710 100644
--- a/pypy/module/sys/test/test_sysmodule.py
+++ b/pypy/module/sys/test/test_sysmodule.py
@@ -141,6 +141,16 @@ class AppTestAppSysTests:
exc = raises(SystemExit, sys.exit, (1, 2, 3))
assert exc.value.code == (1, 2, 3)
+ def test_sys_flags(self):
+ import sys
+ # sanity check
+ assert sys.flags.optimize is not None
+ # make sure the flags are read-only
+ exc = raises(TypeError, 'sys.flags.optimize = 3')
+ assert 'readonly' in str(exc.value)
+ raises(AttributeError, 'sys.flags.not_a_sys_flag = 2')
+
+
class AppTestSysModulePortedFromCPython: