Skip to content

Commit ad00df8

Browse files
author
bstrausser
committed
Add nats-py dependency
1 parent 99c13b7 commit ad00df8

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

modules/nats/tests/test_nats.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,8 @@
1313
"""
1414

1515

16-
NO_NATS_CLIENT = True
17-
try:
18-
from nats import connect as nats_connect
19-
from nats.aio.client import Client as NATSClient
20-
21-
NO_NATS_CLIENT = False
22-
except ImportError:
23-
pass
16+
from nats import connect as nats_connect
17+
from nats.aio.client import Client as NATSClient
2418

2519

2620
async def get_client(container: NatsContainer) -> "NATSClient":
@@ -50,7 +44,6 @@ def test_basic_container_ops():
5044
pytest.mark.usefixtures("anyio_backend")
5145

5246

53-
@pytest.mark.skipif(NO_NATS_CLIENT, reason="No NATS Client Available")
5447
@pytest.mark.parametrize("anyio_backend", ["asyncio"])
5548
async def test_pubsub(anyio_backend):
5649
with NatsContainer() as container:
@@ -72,7 +65,6 @@ async def test_pubsub(anyio_backend):
7265

7366

7467
@pytest.mark.parametrize("anyio_backend", ["asyncio"])
75-
@pytest.mark.skipif(NO_NATS_CLIENT, reason="No NATS Client Available")
7668
async def test_more_complex_example(anyio_backend):
7769
with NatsContainer() as container:
7870
nc: NATSClient = await get_client(container)

poetry.lock

Lines changed: 18 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ pyyaml = { version = "*", optional = true }
7575
python-keycloak = { version = "*", optional = true }
7676
boto3 = { version = "*", optional = true }
7777
minio = { version = "*", optional = true }
78+
nats-py = { version = "*", optional = true }
7879
pymongo = { version = "*", optional = true }
7980
sqlalchemy = { version = "*", optional = true }
8081
pymssql = { version = "*", optional = true }
@@ -101,7 +102,7 @@ minio = ["minio"]
101102
mongodb = ["pymongo"]
102103
mssql = ["sqlalchemy", "pymssql"]
103104
mysql = ["sqlalchemy", "pymysql"]
104-
nats = []
105+
nats = ["nats-py"]
105106
neo4j = ["neo4j"]
106107
nginx = []
107108
opensearch = ["opensearch-py"]

0 commit comments

Comments
 (0)