Closed liiight closed 7 years ago
On an unrelated note, I think the jira_issue
fixture is reversed... Currently it return if the issue is resolved, maybe it should return the opposite, if it's open?
this PR looks good, can you please add these two tests, that we can catch such issue in future?
diff --git a/tests/test_jira.py b/tests/test_jira.py
index a5a087f..c508834 100644
--- a/tests/test_jira.py
+++ b/tests/test_jira.py
@@ -60,6 +60,17 @@ def assert_outcomes(
assert outcomes.get("xfailed", 0) == xfailed
+def test_jira_plugin_disabled(testdir):
+ testdir.makepyfile("""
+ import pytest
+ @pytest.mark.jira("ORG-1382", run=True)
+ def test_pass():
+ assert True
+ """)
+ result = testdir.runpytest()
+ assert_outcomes(result, 1, 0, 0)
+
+
def test_jira_marker_no_args(testdir):
testdir.makeconftest(CONFTEST)
testdir.makepyfile("""
@@ -706,6 +717,17 @@ def test_run_test_case_true1(testdir):
assert_outcomes(result, passed=0, skipped=0, failed=0, error=0, xfailed=1)
+def test_jira_fixture_plugin_disabled(testdir):
+ testdir.makepyfile("""
+ import pytest
+
+ def test_pass(jira_issue):
+ assert jira_issue("ORG-1382") is None
+ """)
+ result = testdir.runpytest()
+ assert_outcomes(result, 1, 0, 0)
+
+
def test_jira_fixture_run_positive(testdir):
testdir.makeconftest(CONFTEST)
testdir.makepyfile("""
regarding to your note, I think it is matter of documentation. you defined interface and described it in readme. so it is fine then.
But feel free to send other PR and we will see.
Merging #81 into master will not change coverage. The diff coverage is
100%
.
@@ Coverage Diff @@
## master #81 +/- ##
=======================================
Coverage 98.34% 98.34%
=======================================
Files 1 1
Lines 181 181
=======================================
Hits 178 178
Misses 3 3
Impacted Files | Coverage Δ | |
---|---|---|
pytest_jira.py | 98.34% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update e7d15eb...17108a9. Read the comment docs.
well, makes more sense to make that having jira_issue(issue_id)
return True
if its unresolved, as in it's still an issue.
also i got another bugfix pending, need you to merge this first since i didn't branch before opening this one 🤕