Author: Antonio Cuni <[email protected]>
Branch: py3k
Changeset: r51764:9868585f9314
Date: 2012-01-25 17:10 +0100
http://bitbucket.org/pypy/pypy/changeset/9868585f9314/

Log:    correctly run docstring-tests when using --appdirect=...

diff --git a/pypy/conftest.py b/pypy/conftest.py
--- a/pypy/conftest.py
+++ b/pypy/conftest.py
@@ -477,7 +477,7 @@
 
 def run_appdirect_or_skip(config, target, src):
     if config.option.appdirect:
-        return run_with_python(self.config.option.appdirect, target)
+        return run_with_python(config.option.appdirect, src)
     if isinstance(src, str):
         # we are trying to directly run a test whose code is inside
         # the docstring. This cannot work because the code might
diff --git a/pypy/tool/pytest/test/test_conftest1.py 
b/pypy/tool/pytest/test/test_conftest1.py
--- a/pypy/tool/pytest/test/test_conftest1.py
+++ b/pypy/tool/pytest/test/test_conftest1.py
@@ -67,5 +67,16 @@
         assert len(passed) == 1
         assert len(skipped) == 2
         assert "test_code_in_docstring_ignored" in passed[0].nodeid
-        assert "app_test_code_in_docstring" in skipped[0].nodeid
+        assert "app_test_code_in_docstring_failing" in skipped[0].nodeid
         assert "test_code_in_docstring_failing" in skipped[1].nodeid
+
+    def test_docstring_appdirect(self, testdir):
+        sorter = testdir.inline_run(innertest,
+                                    '-k', 'test_code_in_docstring',
+                                    '--appdirect=%s' % (sys.executable,))
+        passed, skipped, failed = sorter.listoutcomes()
+        assert len(passed) == 1
+        assert len(failed) == 2
+        assert "test_code_in_docstring_ignored" in passed[0].nodeid
+        assert "app_test_code_in_docstring_failing" in failed[0].nodeid
+        assert "test_code_in_docstring_failing" in failed[1].nodeid
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to