Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
deprecate EventsInDatasetReader
Browse files Browse the repository at this point in the history
  • Loading branch information
TaiSakuma committed Mar 4, 2018
1 parent 8cad31d commit c3a7d40
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions alphatwirl/loop/EventsInDatasetReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
import copy

from .EventLoop import EventLoop
from alphatwirl.misc.deprecation import atdeprecated

##__________________________________________________________________||
@atdeprecated(msg='use EventDatasetReader instead.')
class EventsInDatasetReader(object):
"""This class manages objects involved in reading events in data sets.
Expand Down
13 changes: 13 additions & 0 deletions tests/unit/loop/test_EventsInDatasetReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ def obj(eventLoopRunner, reader, collector, split_into_build_events):
return EventsInDatasetReader(eventLoopRunner, reader, collector,
split_into_build_events)

##__________________________________________________________________||
def test_deprecated(eventLoopRunner, reader, collector, split_into_build_events, caplog):
with caplog.at_level(logging.WARNING):
obj = EventsInDatasetReader(
eventLoopRunner, reader, collector,
split_into_build_events
)

assert len(caplog.records) == 1
assert caplog.records[0].levelname == 'WARNING'
assert 'EventsInDatasetReader' in caplog.records[0].name
assert 'deprecated' in caplog.records[0].msg

##__________________________________________________________________||
def test_repr(obj):
repr(obj)
Expand Down

0 comments on commit c3a7d40

Please sign in to comment.