From 9a0cc54524422dbdd9213e83a8ad7e8a4c13bd3e Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 29 Jan 2019 10:05:10 -0500 Subject: [PATCH] Refs #30137 -- Fixed template test on Windows. Broken in 7785e03ba89aafbd949191f126361fb9103cb980. --- tests/template_tests/test_loaders.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/template_tests/test_loaders.py b/tests/template_tests/test_loaders.py index 9023457751..3c5282a8ea 100644 --- a/tests/template_tests/test_loaders.py +++ b/tests/template_tests/test_loaders.py @@ -195,7 +195,8 @@ class FileSystemLoaderTests(SimpleTestCase): self.engine.get_template(tmpfile.name) def test_notafile_error(self): - with self.assertRaises(IsADirectoryError): + # Windows raises PermissionError when trying to open a directory. + with self.assertRaises(PermissionError if sys.platform.startswith('win') else IsADirectoryError): self.engine.get_template('first')