Skip to content

Commit 949593c

Browse files
committed
Always run the asgi tests
Since the client now requires a minimum of Python 3.9, we don't need to have this feature gate in place any more Signed-off-by: Lexi Robinson <lexi@lexi.org.uk>
1 parent f947140 commit 949593c

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

tests/test_asgi.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1+
import asyncio
12
import gzip
2-
from unittest import skipUnless, TestCase
3+
from unittest import TestCase
34

4-
from prometheus_client import CollectorRegistry, Counter
5-
from prometheus_client.exposition import CONTENT_TYPE_PLAIN_0_0_4
6-
7-
try:
8-
# Python >3.5 only
9-
import asyncio
5+
from asgiref.testing import ApplicationCommunicator
106

11-
from asgiref.testing import ApplicationCommunicator
12-
13-
from prometheus_client import make_asgi_app
14-
HAVE_ASYNCIO_AND_ASGI = True
15-
except ImportError:
16-
HAVE_ASYNCIO_AND_ASGI = False
7+
from prometheus_client import CollectorRegistry, Counter, make_asgi_app
8+
from prometheus_client.exposition import CONTENT_TYPE_PLAIN_0_0_4
179

1810

1911
def setup_testing_defaults(scope):
@@ -33,7 +25,6 @@ def setup_testing_defaults(scope):
3325

3426

3527
class ASGITest(TestCase):
36-
@skipUnless(HAVE_ASYNCIO_AND_ASGI, "Don't have asyncio/asgi installed.")
3728
def setUp(self):
3829
self.registry = CollectorRegistry()
3930
self.captured_status = None

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ envlist = coverage-clean,py{3.9,3.10,3.11,3.12,3.13,py3.9,3.9-nooptionals},cover
33

44
[testenv]
55
deps =
6+
asgiref
67
coverage
78
pytest
89
pytest-benchmark

0 commit comments

Comments
 (0)