my.reddit: better handling for legacy reddit config
prior to this change it would error with @dataclass > class pushshift_config(uconfig.pushshift): E AttributeError: type object 'test_config' has no attribute 'pushshift'
This commit is contained in:
parent
5e9cc2a6a0
commit
be21606075
2 changed files with 8 additions and 1 deletions
|
@ -12,6 +12,9 @@ from my.core.common import Paths, Stats
|
|||
from dataclasses import dataclass
|
||||
from my.core.cfg import make_config
|
||||
|
||||
# note: keeping pushshift import before config import, so it's handled gracefully by import_source
|
||||
from pushshift_comment_export.dal import read_file, PComment
|
||||
|
||||
from my.config import reddit as uconfig
|
||||
|
||||
@dataclass
|
||||
|
@ -29,7 +32,6 @@ from my.core import get_files
|
|||
from typing import Sequence, Iterator
|
||||
from pathlib import Path
|
||||
|
||||
from pushshift_comment_export.dal import read_file, PComment
|
||||
|
||||
|
||||
def inputs() -> Sequence[Path]:
|
||||
|
|
|
@ -11,6 +11,11 @@ def test_basic() -> None:
|
|||
assert len(list(saved())) > 0
|
||||
|
||||
|
||||
def test_comments() -> None:
|
||||
from my.reddit.all import comments
|
||||
assert len(list(comments())) > 0
|
||||
|
||||
|
||||
def test_unfav() -> None:
|
||||
from my.reddit import events, saved
|
||||
ev = events()
|
||||
|
|
Loading…
Add table
Reference in a new issue