From 765db0fc8149aad4c103244e013fdd128af8d3d2 Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 27 Nov 2017 04:22:03 +0100 Subject: move fixtures.py to standardized location conftest.py --- tests/conftest.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/conftest.py (limited to 'tests/conftest.py') diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..1858ab8 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,24 @@ +import pytest + +@pytest.fixture +def mastodon(): + import mastodon as _mastodon + return _mastodon.Mastodon( + api_base_url='http://localhost:3000', + client_id='__MASTODON_PY_TEST_ID', + client_secret='__MASTODON_PY_TEST_SECRET', + access_token='__MASTODON_PY_TEST_TOKEN') + +@pytest.fixture() +def status(mastodon): + _status = mastodon.status_post('Toot!') + yield _status + mastodon.status_delete(_status['id']) + + +@pytest.fixture() +def vcr_config(): + return dict( + match_on = ['method', 'path', 'query', 'body'], + decode_compressed_response = True + ) -- cgit v1.2.3