MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_immutable

Method test_immutable

Lib/test/test_re.py:2919–2928  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2917
2918 @cpython_only
2919 def test_immutable(self):
2920 # bpo-43908: check that re types are immutable
2921 with self.assertRaises(TypeError):
2922 re.Match.foo = 1
2923 with self.assertRaises(TypeError):
2924 re.Pattern.foo = 1
2925 with self.assertRaises(TypeError):
2926 pat = re.compile("")
2927 tp = type(pat.scanner(""))
2928 tp.foo = 1
2929
2930 def test_overlap_table(self):
2931 f = re._compiler._generate_overlap_table

Callers

nothing calls this directly

Calls 3

scannerMethod · 0.80
assertRaisesMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected