Add tests for pmxbot command (and Result.results).

This commit is contained in:
Jason R. Coombs
2016-09-04 11:41:18 -04:00
parent 2c2ba47879
commit c66dc29876
3 changed files with 40 additions and 21 deletions
+29 -1
View File
@@ -1,4 +1,32 @@
import os
import six
import pytest
import wolframalpha
if six.PY2:
collect_ignore = ['wolframalpha/pmxbot.py']
collect_ignore = [
'wolframalpha/pmxbot.py',
'wolframalpha/test_pmxbot.py',
]
@pytest.fixture(scope='session')
def API_key():
"""
To run the tests fully, the environment must be configured
with a WOLFRAMALPHA_API_KEY environment variable. Otherwise,
skip them.
"""
try:
return os.environ['WOLFRAMALPHA_API_KEY']
except KeyError:
pytest.skip("Need WOLFRAMALPHA_API_KEY in environment")
@pytest.fixture(scope='session')
def client(API_key):
return wolframalpha.Client(API_key)