summaryrefslogtreecommitdiff
path: root/ptr.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2012-05-23 16:25:17 -0400
committerJason R. Coombs <jaraco@jaraco.com>2012-05-23 16:25:17 -0400
commit840ff4c2bf6c752d9770f0dd8d64a841060cf9bc (patch)
tree5f9abd3bb6a736a9e9d53130cbc6776d96b8f894 /ptr.py
parent7c9bb5712f3b000698721dd913b4a04623118389 (diff)
downloadpytest-runner-840ff4c2bf6c752d9770f0dd8d64a841060cf9bc.tar.gz
Moved docs into README1.0
Return result_code of test run in case setuptools can use it
Diffstat (limited to 'ptr.py')
-rw-r--r--ptr.py23
1 files changed, 3 insertions, 20 deletions
diff --git a/ptr.py b/ptr.py
index 1394d69..5f70a03 100644
--- a/ptr.py
+++ b/ptr.py
@@ -1,23 +1,5 @@
"""
-Setup scripts can use this to add setup.py test support for pytest runner.
-
-Recommended usage:
-
-- add pytest-runner to your 'setup_requires'
-- include 'pytest' and any other testing requirements to 'tests_require'
-- invoke tests with setup.py ptr
-
-Alternate usage:
-
-- include this file (ptr.py) in your repo
-- add these lines to your setup.py::
-
- execfile('ptr.py')
- setup_params = PyTest.install(dict(...))
- setuptools.setup(**setup_params)
-
- Where '...' are your normal keyword parameters to setup()
-- invoke your tests with setup.py test
+Implementation
"""
import os as _os
@@ -61,6 +43,7 @@ class PyTest(_pytest_runner_test.test):
self.announce('skipping tests (dry run)')
return
self.with_project_on_sys_path(self.run_tests)
+ return self.result_code
def _build_egg_fetcher(self):
"""Build an egg fetcher that respects index_url and allow_hosts"""
@@ -106,7 +89,7 @@ class PyTest(_pytest_runner_test.test):
del sys.argv[1:]
if getattr(self, 'junitxml', None):
sys.argv.append('--junitxml=%s' % self.junitxml)
- pytest.main()
+ self.result_code = pytest.main()
sys.argv[:] = argv_saved
@classmethod