Update tests.yml, revert changes in test files

Add and improve step names
Merge "Lint code" and "Check code-style" steps
Don't install uvloop on macos when running on pypy
Don't run tests with coverage on pypy
Remove test timeout adjustments
This commit is contained in:
evgfilim1 2022-08-20 18:31:46 +05:00
parent 9cdb5e8128
commit b1e66a993e
No known key found for this signature in database
GPG key ID: D9F91B9DC64683A2
3 changed files with 26 additions and 30 deletions

View file

@ -1,6 +1,5 @@
import asyncio
import datetime
import sys
import time
import warnings
from collections import Counter
@ -703,10 +702,7 @@ class TestDispatcher:
dispatcher = Dispatcher()
dispatcher.message.register(simple_message_handler)
# Running this test on PyPy with coverage pytest plugin makes the test run slower
# than expected, so we adjust the timeout accordingly.
timeout = 1 if sys.implementation.name == "pypy" else 0.3
response = await dispatcher.feed_webhook_update(bot, RAW_UPDATE, _timeout=timeout)
response = await dispatcher.feed_webhook_update(bot, RAW_UPDATE, _timeout=0.3)
assert isinstance(response, dict)
assert response["method"] == "sendMessage"
assert response["text"] == "ok"

View file

@ -1,5 +1,4 @@
import asyncio
import sys
import time
from asyncio import Event
from dataclasses import dataclass
@ -116,10 +115,7 @@ class TestSimpleRequestHandler:
handler_event.clear()
resp = await self.make_reqest(client=client)
assert resp.status == 200
# Running this test on PyPy with coverage pytest plugin makes the test run slower
# than expected, so we adjust the timeout accordingly.
timeout = 5 if sys.implementation.name == "pypy" else 1
await asyncio.wait_for(handler_event.wait(), timeout=timeout)
await asyncio.wait_for(handler_event.wait(), timeout=1)
mocked_silent_call_request.assert_awaited()
result = await resp.json()
assert not result