-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL verification and plugin disabling #35
Conversation
vkondula
commented
Jun 6, 2016
- if connection to Jira wasn't established, plugin won't be loaded
- it's possible to disable ssl verification to jira
@@ -29,7 +29,7 @@ submitting feature requests or issues to [issues][githubissues]. | |||
|
|||
## Requires | |||
* pytest >= 2.2.3 | |||
* jira >= 0.13 | |||
* jira >= 0.43 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update requirements.txt
if jira_plugin.is_connected(): | ||
# if connection to jira fails, plugin won't be loaded | ||
ok = config.pluginmanager.register(jira_plugin) | ||
assert ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else:
some_warning(...)
you can use terminal reporter for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inner condition (is_connected) has logger output on line n. 45.
And do we want warning for the outer condition? (missing "--jira" parameter)
@@ -12,16 +12,19 @@ | |||
import re | |||
import six | |||
import pytest | |||
import logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pytest doesn't use logger, use terminalreporter instead https://github.com/pytest-dev/pytest/blob/master/_pytest/terminal.py#L144
dca448e
to
59c4762
Compare
Current coverage is 66.66%@@ master #35 diff @@
==========================================
Files 1 1
Lines 76 96 +20
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 55 64 +9
- Misses 21 32 +11
Partials 0 0
|
except six.moves.configparser.NoOptionError: | ||
verify = True | ||
except ValueError: | ||
console_write('Wrong argument for ssl_verification!') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this branch can be easily covered by
testdir.makefile(
'.cfg',
jira="\n".join([
'[DEFAULT]',
'ssl_verification = something',
])
)
and it will cover console_write function as side-effect ...
2de08f8
to
ce9f4e4
Compare
@@ -15,13 +15,20 @@ | |||
from jira.client import JIRA | |||
|
|||
|
|||
def console_write(message, *args, **kwargs): | |||
tr = pytest.config.pluginmanager.getplugin('terminalreporter') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AttributeError: 'module' object has no attribute 'config'
We can not access pytest.config from here.
1) if connection to Jira wasn't established, plugin won't be loaded 2) it's possible to disable ssl verification to jira