Restructure test fixtures
This commit is contained in:
parent
ae5ed75226
commit
a75e94e43e
11
bulkredditdownloader/tests/conftest.py
Normal file
11
bulkredditdownloader/tests/conftest.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env python3
|
||||
# coding=utf-8
|
||||
|
||||
import praw
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def reddit_instance():
|
||||
rd = praw.Reddit(client_id='U-6gk4ZCh3IeNQ', client_secret='7CZHY6AmKweZME5s50SfDGylaPg', user_agent='test')
|
||||
return rd
|
|
@ -1,7 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# coding=utf-8
|
||||
|
||||
import praw
|
||||
import praw.models
|
||||
import pytest
|
||||
|
||||
|
@ -10,9 +9,8 @@ from bulkredditdownloader.site_downloaders.gallery import Gallery
|
|||
|
||||
|
||||
@pytest.fixture()
|
||||
def reddit_submission() -> praw.models.Submission:
|
||||
rd = praw.Reddit(client_id='U-6gk4ZCh3IeNQ', client_secret='7CZHY6AmKweZME5s50SfDGylaPg', user_agent='test')
|
||||
return rd.submission(id='ljyy27')
|
||||
def reddit_submission(reddit_instance) -> praw.models.Submission:
|
||||
return reddit_instance.submission(id='ljyy27')
|
||||
|
||||
|
||||
def test_gallery(reddit_submission: praw.models.Submission):
|
||||
|
|
|
@ -25,9 +25,8 @@ def submission() -> Mock:
|
|||
|
||||
|
||||
@pytest.fixture()
|
||||
def reddit_submission() -> praw.models.Submission:
|
||||
rd = praw.Reddit(client_id='U-6gk4ZCh3IeNQ', client_secret='7CZHY6AmKweZME5s50SfDGylaPg', user_agent='test')
|
||||
return rd.submission(id='lgilgt')
|
||||
def reddit_submission(reddit_instance) -> praw.models.Submission:
|
||||
return reddit_instance.submission(id='lgilgt')
|
||||
|
||||
|
||||
@pytest.mark.parametrize(('format_string', 'expected'), (('{SUBREDDIT}', 'randomreddit'),
|
||||
|
|
Loading…
Reference in a new issue