Feed the hobgoblins (delint).

This commit is contained in:
Jason R. Coombs 2018-03-04 22:05:10 -05:00
parent 9e0a04079f
commit 923b505128
4 changed files with 15 additions and 8 deletions

View File

@ -8,10 +8,10 @@ import wolframalpha
if six.PY2:
collect_ignore = [
'wolframalpha/pmxbot.py',
'wolframalpha/test_pmxbot.py',
]
collect_ignore = [
'wolframalpha/pmxbot.py',
'wolframalpha/test_pmxbot.py',
]
@pytest.fixture(scope='session')

View File

@ -62,7 +62,7 @@ class ErrorHandler(object):
self._handle_error()
def _handle_error(self):
if not 'error' in self:
if 'error' not in self:
return
template = 'Error {error[code]}: {error[msg]}'
@ -97,7 +97,7 @@ class Assumption(Document):
text = self.template.replace('${desc1}', self.description)
try:
text = text.replace('${word}', self.word)
except:
except Exception:
pass
return text[:text.index('. ') + 1]
@ -207,7 +207,12 @@ class Result(ErrorHandler, Document):
"""
The pods that hold the response to a simple, discrete query.
"""
return (pod for pod in self.pods if pod.primary or pod.title=='Result')
return (
pod
for pod in self.pods
if pod.primary
or pod.title == 'Result'
)
@property
def details(self):

View File

@ -1,6 +1,7 @@
import six
from six.moves import http_client
def fix_HTTPMessage():
"""
Python 2 uses a deprecated method signature and doesn't provide the

View File

@ -1,4 +1,4 @@
#-*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
@ -13,6 +13,7 @@ import wolframalpha
def temp_result(client):
return client.query('30 deg C in deg F')
def test_basic(temp_result):
res = temp_result
assert len(list(res.pods)) > 0