diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2018-02-10 14:55:54 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2018-02-10 14:58:40 -0500 |
commit | 95f4e9fbd57add2505f0325bd53246389f46006c (patch) | |
tree | 1b11c77ce565761b83835c077b43415743500db8 | |
parent | 016a84e3bc1ec56b6986b3f33144892ac618a5d5 (diff) | |
download | pytest-runner-95f4e9fbd57add2505f0325bd53246389f46006c.tar.gz |
Avoid AttributeError when self.result_code was not set, such as when running with dry_run. Fixes #38.
-rw-r--r-- | CHANGES.rst | 9 | ||||
-rw-r--r-- | ptr.py | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index 0e59e0a..b0ad590 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,12 @@ +3.0.1 +~~~~~ + +* #38: Fixed AttributeError when running with ``--dry-run``. + ``PyTest.run()`` no longer 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. + 3.0 ~~~ @@ -192,9 +192,8 @@ class PyTest(orig.test): don't install them anywhere). """ self._super_run() - if self.result_code: + if getattr(self, 'result_code', None): raise SystemExit(self.result_code) - return self.result_code @property def _argv(self): |