2016-09-04 15:41:18 +00:00
|
|
|
import os
|
|
|
|
|
2015-12-11 17:35:36 +00:00
|
|
|
import six
|
|
|
|
|
2016-09-04 15:41:18 +00:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
import wolframalpha
|
|
|
|
|
|
|
|
|
2015-12-11 17:35:36 +00:00
|
|
|
if six.PY2:
|
2018-03-05 03:05:10 +00:00
|
|
|
collect_ignore = [
|
|
|
|
'wolframalpha/pmxbot.py',
|
|
|
|
'wolframalpha/test_pmxbot.py',
|
|
|
|
]
|
2016-09-04 15:41:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
@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)
|