File: support.py

package info (click to toggle)
pygments 2.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,628 kB
  • ctags: 5,425
  • sloc: python: 69,950; makefile: 217; sh: 117
file content (17 lines) | stat: -rw-r--r-- 349 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# coding: utf-8
"""
Support for Pygments tests
"""

import os

from nose import SkipTest


def location(mod_name):
    """
    Return the file and directory that the code for *mod_name* is in.
    """
    source = mod_name.endswith("pyc") and mod_name[:-1] or mod_name
    source = os.path.abspath(source)
    return source, os.path.dirname(source)