aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index a0733b5..f6ee327 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,21 +1,28 @@
1import pytest 1import pytest
2 2
3@pytest.fixture 3
4def api(): 4def _api(access_token='__MASTODON_PY_TEST_ACCESS_TOKEN'):
5 import mastodon 5 import mastodon
6 return mastodon.Mastodon( 6 return mastodon.Mastodon(
7 api_base_url='http://localhost:3000', 7 api_base_url='http://localhost:3000',
8 client_id='__MASTODON_PY_TEST_ID', 8 client_id='__MASTODON_PY_TEST_CLIENT_ID',
9 client_secret='__MASTODON_PY_TEST_SECRET', 9 client_secret='__MASTODON_PY_TEST_CLIENT_SECRET',
10 access_token='__MASTODON_PY_TEST_TOKEN') 10 access_token=access_token)
11
12
13@pytest.fixture
14def api():
15 return _api()
16
17
18@pytest.fixture
19def api2():
20 return _api(access_token='__MASTODON_PY_TEST_ACCESS_TOKEN_2')
21
11 22
12@pytest.fixture 23@pytest.fixture
13def api_anonymous(): 24def api_anonymous():
14 import mastodon 25 return _api(access_token=None)
15 return mastodon.Mastodon(
16 api_base_url='http://localhost:3000',
17 client_id='__MASTODON_PY_TEST_ID',
18 client_secret='__MASTODON_PY_TEST_SECRET')
19 26
20@pytest.fixture() 27@pytest.fixture()
21def status(api): 28def status(api):
Powered by cgit v1.2.3 (git 2.41.0)