Skip to content

Commit

Permalink
Fix some errors with tests
Browse files Browse the repository at this point in the history
Signed-off-by: LilSpazJoekp <15524072+LilSpazJoekp@users.noreply.github.com>
  • Loading branch information
LilSpazJoekp committed Dec 13, 2020
1 parent ad443d6 commit 50264c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def setUp(self):
self.setup_vcr()

async def tearDown(self) -> None:
await self.reddit._core._requestor._http.close()
await self.reddit._core.close()

def setup_vcr(self):
"""Configure VCR instance."""
Expand Down
1 change: 1 addition & 0 deletions tests/unit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ async def setUp(self):
client_id="dummy", client_secret="dummy", user_agent="dummy"
)
# Unit tests should never issue requests
await self.reddit._core.close()
self.reddit._core._requestor._http = None
4 changes: 2 additions & 2 deletions tests/unit/models/reddit/test_rules.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import pytest

from asyncpraw.models import Rule
from asyncpraw.models import Rule, Subreddit

from ... import UnitTest


class TestRules(UnitTest):
@property
def subreddit(self):
return self.reddit.subreddit(pytest.placeholders.test_subreddit)
return Subreddit(self.reddit, display_name=pytest.placeholders.test_subreddit)

def test_no_data(self):
with pytest.raises(ValueError) as excinfo:
Expand Down

0 comments on commit 50264c9

Please sign in to comment.