(self)
| 187 | self.assertGreater(content_count, 0) |
| 188 | |
| 189 | def test_exception(self): |
| 190 | # set up engine |
| 191 | def _train_func(engine, batch): |
| 192 | raise RuntimeError("test exception.") |
| 193 | |
| 194 | engine = Engine(_train_func) |
| 195 | |
| 196 | # set up testing handler |
| 197 | stats_handler = StatsHandler() |
| 198 | stats_handler.attach(engine) |
| 199 | |
| 200 | with self.assertRaises(RuntimeError): |
| 201 | engine.run(range(3), max_epochs=2) |
| 202 | |
| 203 | def test_attributes_print(self): |
| 204 | log_stream = StringIO() |
nothing calls this directly
no test coverage detected