Feed the hobgoblins (delint).

master
Jason R. Coombs 6 years ago
parent 9e0a04079f
commit 923b505128
  1. 8
      conftest.py
  2. 11
      wolframalpha/__init__.py
  3. 1
      wolframalpha/compat.py
  4. 3
      wolframalpha/test_client.py

@ -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')

@ -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):

@ -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

@ -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

Loading…
Cancel
Save