def get_app(self, loop): self.fake_atv = FakeAppleTV(loop, HSGID, SESSION_ID, self) self.usecase = AppleTVUseCases(self.fake_atv) # Import TestServer here and not globally, otherwise py.test will # complain when running: # # test_functional.py cannot collect test class 'TestServer' # because it has a __init__ constructor from aiohttp.test_utils import TestServer return TestServer(self.fake_atv)