summaryrefslogtreecommitdiff
path: root/tests/support.py
blob: c66ac66336f85231d99d2fb4abd7ced8fe1fd0b1 (plain)
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)