From 404de93d1427b67e5a0936241bc2f6b8cdab522f Mon Sep 17 00:00:00 2001 From: Or Carmi Date: Mon, 31 Jul 2017 18:03:40 +0300 Subject: [PATCH] Flipped fixture return value, now return True if issue is open, False if resolved (as it is documented) (#83) --- pytest_jira.py | 2 +- tests/test_jira.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pytest_jira.py b/pytest_jira.py index aa1af2a..8565a4d 100644 --- a/pytest_jira.py +++ b/pytest_jira.py @@ -458,6 +458,6 @@ def jira_issue(request): def wrapper_jira_issue(issue_id): jira_plugin = getattr(request.config, '_jira', None) if jira_plugin and jira_plugin.conn.is_connected(): - return jira_plugin.is_issue_resolved(issue_id) + return not jira_plugin.is_issue_resolved(issue_id) return wrapper_jira_issue diff --git a/tests/test_jira.py b/tests/test_jira.py index e0ba6cc..4850629 100644 --- a/tests/test_jira.py +++ b/tests/test_jira.py @@ -734,7 +734,7 @@ def test_jira_fixture_run_positive(testdir): import pytest def test_pass(jira_issue): - assert not jira_issue("ORG-1382") + assert jira_issue("ORG-1382") """) result = testdir.runpytest(*PLUGIN_ARGS) result.assert_outcomes(1, 0, 0) @@ -746,7 +746,7 @@ def test_jira_fixture_run_negative(testdir): import pytest def test_pass(jira_issue): - assert jira_issue("ORG-1382") + assert not jira_issue("ORG-1382") """) result = testdir.runpytest(*PLUGIN_ARGS) result.assert_outcomes(0, 0, 1)