summaryrefslogtreecommitdiff
path: root/tests/test_examplefiles.py
diff options
context:
space:
mode:
authorthatch <devnull@localhost>2008-09-24 20:23:55 -0700
committerthatch <devnull@localhost>2008-09-24 20:23:55 -0700
commitd4608a2ea92d1af34c25ae164a760ef828610366 (patch)
tree6b3cc5d67fd079520525cb0ecfac0ad91da34ae8 /tests/test_examplefiles.py
parent52afb43cd14c7a9a63c4788c25b078994c32c146 (diff)
downloadpygments-d4608a2ea92d1af34c25ae164a760ef828610366.tar.gz
Make test_examplefiles show a better error when there are strange files
hanging out in the examplefiles dir.
Diffstat (limited to 'tests/test_examplefiles.py')
-rw-r--r--tests/test_examplefiles.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_examplefiles.py b/tests/test_examplefiles.py
index 2ebb2101..ddaa53bf 100644
--- a/tests/test_examplefiles.py
+++ b/tests/test_examplefiles.py
@@ -27,6 +27,11 @@ def test_example_files():
try:
lx = get_lexer_for_filename(absfn)
except ClassNotFound:
+ if "_" not in fn:
+ raise AssertionError('file %r has no registered extension, '
+ 'nor is of the form <lexer>_filename '
+ 'for overriding, thus no lexer found.'
+ % fn)
try:
name, rest = fn.split("_", 1)
lx = get_lexer_by_name(name)