(self)
| 1900 | test_pickle_dump_load(self.assertIs, Name.BDFL) |
| 1901 | |
| 1902 | def test_extending(self): |
| 1903 | class Color(Enum): |
| 1904 | red = 1 |
| 1905 | green = 2 |
| 1906 | blue = 3 |
| 1907 | # |
| 1908 | with self.assertRaises(TypeError): |
| 1909 | class MoreColor(Color): |
| 1910 | cyan = 4 |
| 1911 | magenta = 5 |
| 1912 | yellow = 6 |
| 1913 | # |
| 1914 | with self.assertRaisesRegex(TypeError, "<enum .EvenMoreColor.> cannot extend <enum .Color.>"): |
| 1915 | class EvenMoreColor(Color, IntEnum): |
| 1916 | chartruese = 7 |
| 1917 | # |
| 1918 | with self.assertRaisesRegex(ValueError, r"\(.Foo., \(.pink., .black.\)\) is not a valid .*Color"): |
| 1919 | Color('Foo', ('pink', 'black')) |
| 1920 | |
| 1921 | def test_exclude_methods(self): |
| 1922 | class whatever(Enum): |
nothing calls this directly
no test coverage detected