def test_builds_returnloggers(self): """ Factory returns ReturnLoggers. """ f = ReturnLoggerFactory() assert isinstance(f(), ReturnLogger)
def test_caches(self): """ There's no need to have several loggers so we return the same one on each call. """ f = ReturnLoggerFactory() assert f() is f()
def test_ignores_args(self): """ ReturnLogger doesn't take positional arguments. If any are passed to the factory, they are not passed to the logger. """ ReturnLoggerFactory()(1, 2, 3)