mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 13:29:47 +00:00
Remove sync hack
This commit is contained in:
@@ -14,43 +14,6 @@ def test_strip_text():
|
||||
# I can't interpret the rest of the code well enough yet
|
||||
|
||||
|
||||
class TestSyncifyAsyncContext:
|
||||
class NoopContextManager:
|
||||
def __init__(self, loop):
|
||||
self.count = 0
|
||||
self.loop = loop
|
||||
|
||||
async def __aenter__(self):
|
||||
self.count += 1
|
||||
return self
|
||||
|
||||
async def __aexit__(self, exc_type, *args):
|
||||
assert exc_type is None
|
||||
self.count -= 1
|
||||
|
||||
__enter__ = helpers._sync_enter
|
||||
__exit__ = helpers._sync_exit
|
||||
|
||||
def test_sync_acontext(self, event_loop):
|
||||
contm = self.NoopContextManager(event_loop)
|
||||
assert contm.count == 0
|
||||
|
||||
with contm:
|
||||
assert contm.count == 1
|
||||
|
||||
assert contm.count == 0
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_async_acontext(self, event_loop):
|
||||
contm = self.NoopContextManager(event_loop)
|
||||
assert contm.count == 0
|
||||
|
||||
async with contm:
|
||||
assert contm.count == 1
|
||||
|
||||
assert contm.count == 0
|
||||
|
||||
|
||||
def test_generate_key_data_from_nonce():
|
||||
gkdfn = helpers.generate_key_data_from_nonce
|
||||
|
||||
|
Reference in New Issue
Block a user