summaryrefslogtreecommitdiff
path: root/tests/support.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2008-09-23 23:06:28 +0200
committergbrandl <devnull@localhost>2008-09-23 23:06:28 +0200
commita34d0680ec7181202ee5adb4bf185ff1ffc9e0ed (patch)
tree9eafc4f149b9a17216fd0d08e5e36ecbf5761335 /tests/support.py
parent6e735f945f1845566f9e5dbcf956b6d1c8f54916 (diff)
parent420f7fa8594b96d6eed23073f0525a431218bb3e (diff)
downloadpygments-a34d0680ec7181202ee5adb4bf185ff1ffc9e0ed.tar.gz
Merge with ben-file2open.
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..67cf69d7
--- /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[:-1] if mod_name.endswith("pyc") else mod_name
+ source = os.path.abspath(source)
+ return source, os.path.dirname(source)