(self, fn, filename,
expected_exception=FileNotFoundError,
check_filename=True)
| 84 | return s |
| 85 | |
| 86 | def _apply_failure(self, fn, filename, |
| 87 | expected_exception=FileNotFoundError, |
| 88 | check_filename=True): |
| 89 | with self.assertRaises(expected_exception) as c: |
| 90 | fn(filename) |
| 91 | exc_filename = c.exception.filename |
| 92 | if check_filename: |
| 93 | self.assertEqual(exc_filename, filename, "Function '%s(%a) failed " |
| 94 | "with bad filename in the exception: %a" % |
| 95 | (fn.__name__, filename, exc_filename)) |
| 96 | |
| 97 | def test_failures(self): |
| 98 | # Pass non-existing Unicode filenames all over the place. |
no test coverage detected