1
0
Fork 0
mirror of synced 2024-06-14 08:14:42 +12:00

Restructure test fixtures

This commit is contained in:
Serene-Arc 2021-02-15 19:16:51 +10:00 committed by Ali Parlakci
parent ae5ed75226
commit a75e94e43e
3 changed files with 15 additions and 7 deletions

View 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

View file

@ -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):

View file

@ -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'),