File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -392,6 +392,14 @@ def skip_unreadable_post(record):
392392 "ietf/utils/templatetags/debug_filters.py" ,
393393]
394394
395+ # These are filename globs. They are used by test_parse_templates() and
396+ # get_template_paths()
397+ TEST_TEMPLATE_IGNORE = [
398+ ".*" , # dot-files
399+ "*~" , # tilde temp-files
400+ "#*" , # files beginning with a hashmark
401+ ]
402+
395403TEST_COVERAGE_MASTER_FILE = os .path .join (BASE_DIR , "../release-coverage.json.gz" )
396404TEST_COVERAGE_LATEST_FILE = os .path .join (BASE_DIR , "../latest-coverage.json" )
397405
Original file line number Diff line number Diff line change 4646import codecs
4747import gzip
4848import unittest
49+ from fnmatch import fnmatch
4950
5051from coverage .report import Reporter
5152from coverage .results import Numbers
@@ -161,7 +162,12 @@ def get_template_paths(apps=None):
161162 dirs .remove (".svn" )
162163 relative_path = dirpath [len (templatepath )+ 1 :]
163164 for file in files :
164- if file .endswith ("~" ) or file .startswith ("#" ):
165+ ignore = False
166+ for pattern in settings .TEST_TEMPLATE_IGNORE :
167+ if fnmatch (file , pattern ):
168+ ignore = True
169+ break
170+ if ignore :
165171 continue
166172 if relative_path != "" :
167173 file = os .path .join (relative_path , file )
Original file line number Diff line number Diff line change 55from StringIO import StringIO
66from pipe import pipe
77from unittest import skipIf
8+ from fnmatch import fnmatch
89
910from textwrap import dedent
1011from email .mime .text import MIMEText
@@ -103,6 +104,7 @@ def get_callbacks(urllist):
103104
104105 return list (callbacks )
105106
107+ debug .debug = True
106108class TemplateChecksTestCase (TestCase ):
107109
108110 paths = []
@@ -124,7 +126,11 @@ def tearDown(self):
124126 def test_parse_templates (self ):
125127 errors = []
126128 for path in self .paths :
129+ for pattern in settings .TEST_TEMPLATE_IGNORE :
130+ if fnmatch (path , pattern ):
131+ continue
127132 if not path in self .templates :
133+
128134 try :
129135 self .loader .load_template (path )
130136 except Exception as e :
You can’t perform that action at this time.
0 commit comments