summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2018-02-10 15:10:19 -0500
committerJason R. Coombs <jaraco@jaraco.com>2018-02-10 15:10:19 -0500
commit7631c231838d8ff766cc2065ccd8651a9a0ddba0 (patch)
tree81253673334b877a0bfbb8f9a295aac7943c4cfb
parentb11624dea5b6337e442f0103c9b2f1bdd44b2995 (diff)
downloadpytest-runner-7631c231838d8ff766cc2065ccd8651a9a0ddba0.tar.gz
Don't store the result_code. Just use it immediately.
-rw-r--r--CHANGES.rst4
-rw-r--r--ptr.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 28f1b8a..48dce72 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -2,8 +2,8 @@
=====
* #38: Fixed AttributeError when running with ``--dry-run``.
- ``PyTest.run()`` no longer returns the result code. Based on
- the commit message for `840ff4c <
+ ``PyTest.run()`` no longer stores nor returns the result code.
+ Based on the commit message for `840ff4c <
https://github.com/pytest-dev/pytest-runner/commit/840ff4c2bf6c752d9770f0dd8d64a841060cf9bc>`_,
nothing has ever relied on that value.
diff --git a/ptr.py b/ptr.py
index 3de0129..a944278 100644
--- a/ptr.py
+++ b/ptr.py
@@ -192,8 +192,6 @@ class PyTest(orig.test):
don't install them anywhere).
"""
self._super_run()
- if getattr(self, 'result_code', None):
- raise SystemExit(self.result_code)
@property
def _argv(self):
@@ -204,4 +202,6 @@ class PyTest(orig.test):
Invoke pytest, replacing argv.
"""
with _save_argv(_sys.argv[:1] + self.addopts):
- self.result_code = __import__('pytest').main()
+ result_code = __import__('pytest').main()
+ if result_code:
+ raise SystemExit(result_code)