summaryrefslogtreecommitdiff
path: root/tests/support.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2008-09-24 18:14:55 +0200
committergbrandl <devnull@localhost>2008-09-24 18:14:55 +0200
commit938060f2faccba4abbae4c298e93a537296cf89c (patch)
tree3422585d35ab955c5859be0f9d460f4ecc195eb6 /tests/support.py
parentd0634d959bb52e1378cf866acc53df731e069b17 (diff)
parentd2e1a6638b3746142537e224b06fd842475798d0 (diff)
downloadpygments-938060f2faccba4abbae4c298e93a537296cf89c.tar.gz
Merge with Tim.
Diffstat (limited to 'tests/support.py')
-rw-r--r--tests/support.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/support.py b/tests/support.py
new file mode 100644
index 00000000..505c17da
--- /dev/null
+++ b/tests/support.py
@@ -0,0 +1,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.endswith("pyc") and mod_name[:-1] or mod_name
+ source = os.path.abspath(source)
+ return source, os.path.dirname(source)