From f9bc6c5115d4c19c55b017261b4ab7207dc55a41 Mon Sep 17 00:00:00 2001 From: Markus Steinlein Date: Mon, 8 Mar 2021 15:53:20 +0100 Subject: [PATCH] Added additional check for non html files to avoid system files like '.DS_store' or '.thumbsdb' messing up tests. --- tests/test_static_pages.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_static_pages.py b/tests/test_static_pages.py index 8ecab49..900c8cc 100644 --- a/tests/test_static_pages.py +++ b/tests/test_static_pages.py @@ -13,7 +13,11 @@ def test_static_pages(app, client): if f == "template.html" or f == "page.html": continue - static_file = f.split('.',1)[0] + # ignore non html files like system files e.g. '.DS_Store', '.thumbsdb', ... + if f.split('.', 1)[1] not in ['html', 'htm']: + continue + + static_file = f.split('.', 1)[0] page = "/" + static_file + ".html" print("Checking presence of: ", page) res = client.get(page)