diff options
Diffstat (limited to 'Lib/test/test_opcodes.py')
-rw-r--r-- | Lib/test/test_opcodes.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_opcodes.py b/Lib/test/test_opcodes.py index 8fe77ac6b7..4403a114d2 100644 --- a/Lib/test/test_opcodes.py +++ b/Lib/test/test_opcodes.py @@ -98,6 +98,12 @@ class OpcodeTest(unittest.TestCase): g = eval('lambda a=1: None') self.assertNotEquals(f, g) + def test_modulo_of_string_subclasses(self): + class MyString(str): + def __mod__(self, value): + return 42 + self.assertEqual(MyString() % 3, 42) + def test_main(): run_unittest(OpcodeTest) |