core/stats: exclude contextmanagers from guess_stats
This commit is contained in:
parent
fb2b3e07de
commit
70bf51a125
2 changed files with 12 additions and 2 deletions
|
@ -1,11 +1,11 @@
|
|||
"""
|
||||
Helper 'module' for test_guess_stats
|
||||
"""
|
||||
|
||||
from contextlib import contextmanager
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime, timedelta
|
||||
from pathlib import Path
|
||||
from typing import Iterable, Sequence
|
||||
from typing import Iterable, Sequence, Iterator
|
||||
|
||||
|
||||
@dataclass
|
||||
|
@ -28,3 +28,9 @@ def iter_data() -> Iterable[Item]:
|
|||
for path in inputs():
|
||||
for i in range(3):
|
||||
yield Item(id=str(i), dt=dt + timedelta(days=i), source=path)
|
||||
|
||||
|
||||
@contextmanager
|
||||
def some_contextmanager() -> Iterator[str]:
|
||||
# this shouldn't end up in guess_stats because context manager is not a data provider
|
||||
yield 'hello'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue