Add tests for pmxbot command (and Result.results).
This commit is contained in:
+29
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user