summaryrefslogtreecommitdiff
path: root/tests/support.py
blob: 67cf69d7562245b1d31007b3c187d9c12c961b9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# coding: utf-8
"""
Support for Pygments tests
"""

import os


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