(self)
| 176 | |
| 177 | class TestAutoreload(Fixture): |
| 178 | def test_reload_enums(self): |
| 179 | mod_name, mod_fn = self.new_module( |
| 180 | textwrap.dedent( |
| 181 | """ |
| 182 | from enum import Enum |
| 183 | class MyEnum(Enum): |
| 184 | A = 'A' |
| 185 | B = 'B' |
| 186 | """ |
| 187 | ) |
| 188 | ) |
| 189 | self.shell.magic_autoreload("2") |
| 190 | self.shell.magic_aimport(mod_name) |
| 191 | self.write_file( |
| 192 | mod_fn, |
| 193 | textwrap.dedent( |
| 194 | """ |
| 195 | from enum import Enum |
| 196 | class MyEnum(Enum): |
| 197 | A = 'A' |
| 198 | B = 'B' |
| 199 | C = 'C' |
| 200 | """ |
| 201 | ), |
| 202 | ) |
| 203 | with tt.AssertNotPrints( |
| 204 | ("[autoreload of %s failed:" % mod_name), channel="stderr" |
| 205 | ): |
| 206 | self.shell.run_code("pass") # trigger another reload |
| 207 | |
| 208 | def test_reload_class_type(self): |
| 209 | self.shell.magic_autoreload("2") |
nothing calls this directly
no test coverage detected