Commits

thatch  committed 61935f4

Make test_examplefiles show a better error when there are strange files
hanging out in the examplefiles dir.

  • Participants
  • Parent commits 4bbd901
  • Branches trunk

Comments (0)

Files changed (1)

File tests/test_examplefiles.py

         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)