summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJP <jpellerin@gmail.com>2013-04-07 09:26:10 -0400
committerJP <jpellerin@gmail.com>2013-04-07 09:26:10 -0400
commit020f40cc20243291777d24704eca4ea54e410a97 (patch)
treeda2810b2fbedca698b08ad4359eb7a0b3cd61f17
parent1fed578436d523077bccf843eeef5ec2fe430809 (diff)
parent7727369ae96f6acd2202e37b8a22a6b3d2863377 (diff)
downloadnose-020f40cc20243291777d24704eca4ea54e410a97.tar.gz
Merge remote-tracking branch 'jszakmeister/fix-broken-autoplugin-directive' into autopluginfix
-rw-r--r--nose/sphinx/pluginopts.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/nose/sphinx/pluginopts.py b/nose/sphinx/pluginopts.py
index 428a5b9..d2b284a 100644
--- a/nose/sphinx/pluginopts.py
+++ b/nose/sphinx/pluginopts.py
@@ -32,7 +32,7 @@ produces::
"""
import os
try:
- from docutils import nodes
+ from docutils import nodes, utils
from docutils.statemachine import ViewList
from docutils.parsers.rst import directives
except ImportError:
@@ -45,6 +45,7 @@ from nose.config import Config
from nose.core import TestProgram
from inspect import isclass
+
def autoplugin_directive(dirname, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
mod_name = arguments[0]
@@ -91,9 +92,11 @@ def autoplugin_directive(dirname, arguments, options, content, lineno,
# source
rst.append('Source', '<autodoc>')
rst.append('------', '<autodoc>')
- rst.append('.. include :: %s\n' % os.path.abspath(
- mod.__file__.replace('.pyc', '.py')),
- '<autodoc>')
+ rst.append(
+ '.. include :: %s\n' % utils.relative_path(
+ state_machine.document['source'],
+ os.path.abspath(mod.__file__.replace('.pyc', '.py'))),
+ '<autodoc>')
rst.append(' :literal:\n', '<autodoc>')
rst.append('', '<autodoc>')