summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/subunit/__init__.py3
-rw-r--r--python/subunit/tests/test_test_protocol.py7
2 files changed, 6 insertions, 4 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py
index caab176..f56f724 100644
--- a/python/subunit/__init__.py
+++ b/python/subunit/__init__.py
@@ -283,7 +283,8 @@ class ExecTestCase(unittest.TestCase):
"""
unittest.TestCase.__init__(self, methodName)
testMethod = getattr(self, methodName)
- self.script = testMethod.__doc__
+ self.script = sibpath(sys.modules[self.__class__.__module__].__file__,
+ testMethod.__doc__)
def countTestCases(self):
return 1
diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py
index e6d6f0d..4cd693d 100644
--- a/python/subunit/tests/test_test_protocol.py
+++ b/python/subunit/tests/test_test_protocol.py
@@ -562,14 +562,15 @@ class TestExecTestCase(unittest.TestCase):
class SampleExecTestCase(subunit.ExecTestCase):
def test_sample_method(self):
- """./python/subunit/tests/sample-script.py"""
+ """sample-script.py"""
# the sample script runs three tests, one each
# that fails, errors and succeeds
def test_construct(self):
test = self.SampleExecTestCase("test_sample_method")
- self.assertEqual(test.script, "./python/subunit/tests/sample-script.py")
+ self.assertEqual(test.script,
+ subunit.sibpath(__file__, 'sample-script.py'))
def test_run(self):
runner = MockTestProtocolServerClient()
@@ -603,7 +604,7 @@ class TestExecTestCase(unittest.TestCase):
class DoExecTestCase(subunit.ExecTestCase):
def test_working_script(self):
- """./python/subunit/tests/sample-two-script.py"""
+ """sample-two-script.py"""
class TestIsolatedTestCase(unittest.TestCase):