Skip to content

Commit f01d4d2

Browse files
codehobbyist06Anshul Pandey
authored andcommitted
Fix travis CI build issues
Dockerfile: Change python version Changed python version to 3.6 to make it compatible to igitt. setup.cfg: Correct doc-test cli parameter Added a missing 's' to the doc-test cli parameter wolfram_alpha.py: Remove unused code Removed try-except section which was not called and added new log wolfram_alpha_test.py: Change assert Changed assert statement according to new log in wolfram_alpha.py test-requirements: Update pytest-cov version Changed pytest-cov version to be less than 2.9 to solve dependency conflicts Fixes #667
1 parent 87c35cb commit f01d4d2

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3-alpine
1+
FROM python:3.6-alpine
22

33
ENV BOT_ROOT=/opt/errbot
44

plugins/wolfram_alpha.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ def wa(self, msg, arg):
2424
"""
2525
ans = ''
2626
res = self.client.query(arg)
27-
try:
28-
for pod in res.pods:
29-
if pod.title in ['Result', 'Results']:
30-
for sub in pod.subpods:
31-
ans += sub.plaintext
32-
except AttributeError:
33-
self.log.info('KeyError triggered on retrieving pods.')
27+
for pod in res.pods:
28+
if pod.title in ['Result', 'Results']:
29+
for sub in pod.subpods:
30+
ans += sub.plaintext
31+
if ans == '':
32+
self.log.info("No results found!")
3433
return ans if ans else 'Dunno :('

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ addopts =
1818
-p no:logging
1919
--color=yes
2020
--doctest-glob=*.rst
21-
--doctest-ignore-import-error
21+
--doctest-ignore-import-errors
2222
--error-for-skips
2323
--cov
2424
--instafail

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ codecov~=2.0.5
1313
moban~=0.3.3 ; python_version > '3.0'
1414
packaging~=16.8
1515
pytest~=3.6.4
16-
pytest-cov~=2.4
16+
pytest-cov>=2.4,<=2.9
1717
pytest-env~=0.6.0
1818
pytest-error-for-skips~=1.0
1919
pytest-instafail~=0.3.0

tests/wolfram_alpha_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_wa(self):
1818
with self.assertLogs() as cm:
1919
self.assertCommand('!wa this is a sentence',
2020
'Dunno')
21-
self.assertIn('INFO:errbot.plugins.WolframAlpha:KeyError triggered on '
22-
'retrieving pods.', cm.output)
21+
self.assertIn('INFO:errbot.plugins.WolframAlpha:'
22+
'No results found!', cm.output)
2323
self.assertCommand('!plugin config WolframAlpha',
2424
'{\'WA_TOKEN\': None}')

0 commit comments

Comments
 (0)