Skip to content

Commit

Permalink
Always skip issue when run is False (#82)
Browse files Browse the repository at this point in the history
* Fixed always skip when run is set to False

* Switched resolves status to be a list instead of a generator since they were consumed and then not correctly checked from cache

* Accidently removed tests

* switched to tuple
  • Loading branch information
liiight authored and lukas-bednar committed Jul 31, 2017
1 parent 22bf4e8 commit d31c80b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pytest_jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import six

PYTEST_MAJOR_VERSION = int(pytest.__version__.split(".")[0])
DEFAULT_RESOLVE_STATUSES = ('closed', 'resolved')
DEFAULT_RESOLVE_STATUSES = 'closed', 'resolved'
DEFAULT_RUN_TEST_CASE = True


Expand Down Expand Up @@ -412,12 +412,12 @@ def pytest_configure(config):

resolved_statuses = config.getvalue('jira_resolved_statuses')
if isinstance(resolved_statuses, six.string_types):
resolved_statuses = (
resolved_statuses = [
s.strip().lower() for s in resolved_statuses.split(',')
if s.strip()
)
]
if not resolved_statuses:
resolved_statuses = DEFAULT_RESOLVE_STATUSES
resolved_statuses = list(DEFAULT_RESOLVE_STATUSES)

if config.getvalue('jira') and config.getvalue('jira_url'):
jira_connection = JiraSiteConnection(
Expand Down
13 changes: 13 additions & 0 deletions tests/test_jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,3 +750,16 @@ def test_pass(jira_issue):
""")
result = testdir.runpytest(*PLUGIN_ARGS)
result.assert_outcomes(0, 0, 1)


def test_run_false_for_resolved_issue(testdir):
testdir.makeconftest(CONFTEST)
testdir.makepyfile("""
import pytest
@pytest.mark.jira("ORG-1412", run=False)
def test_pass():
assert True
""")
result = testdir.runpytest(*PLUGIN_ARGS)
result.assert_outcomes(1, 0, 0)

0 comments on commit d31c80b

Please sign in to comment.