Skip to content

Commit e5a1022

Browse files
authored
INTPYTHON-779 Fix handling of resource warning (#223)
1 parent 221b864 commit e5a1022

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

libs/langchain-mongodb/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ markers = [
5757
asyncio_mode = "auto"
5858
asyncio_default_fixture_loop_scope = "function"
5959
filterwarnings = [
60-
"error"
60+
"error",
61+
# Ignore ResourceWarning raised by langchain standardized base classes.
62+
"ignore:unclosed <socket.socket:ResourceWarning",
6163
]
6264

6365
[tool.mypy]

libs/langchain-mongodb/tests/integration_tests/test_tools.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import Type
22

3-
import pytest
43
from langchain_tests.integration_tests import ToolsIntegrationTests
54

65
from langchain_mongodb.agent_toolkit.tool import (
@@ -12,9 +11,6 @@
1211
)
1312
from tests.utils import create_database, create_llm
1413

15-
# Ignore ResourceWarning raised by base class.
16-
pytestmark = pytest.mark.filterwarnings("ignore:unclosed:ResourceWarning")
17-
1814

1915
class TestQueryMongoDBDatabaseToolIntegration(ToolsIntegrationTests):
2016
_db: MongoDBDatabase

libs/langchain-mongodb/tests/integration_tests/test_vectorstore_standard.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
DIMENSIONS = 6
2020

2121

22-
# Ignore ResourceWarning raised by base class.
23-
pytestmark = pytest.mark.filterwarnings("ignore:unclosed:ResourceWarning")
24-
25-
2622
@pytest.fixture
2723
def collection(client: MongoClient) -> Collection:
2824
if COLLECTION_NAME not in client[DB_NAME].list_collection_names():

0 commit comments

Comments
 (0)