Skip to content

Commit c163396

Browse files
authored
python312Packages.langchain-chroma: fix broken tests (#345803)
2 parents 58675fa + 6101b56 commit c163396

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/libs/partners/chroma/tests/integration_tests/test_vectorstores.py b/libs/partners/chroma/tests/integration_tests/test_vectorstores.py
2+
index 382b24cb5..f99a34112 100644
3+
--- a/tests/integration_tests/test_vectorstores.py
4+
+++ b/tests/integration_tests/test_vectorstores.py
5+
@@ -36,7 +36,7 @@ def test_chroma() -> None:
6+
7+
assert output == [Document(page_content="foo")]
8+
9+
-
10+
+@pytest.mark.asyncio
11+
async def test_chroma_async() -> None:
12+
"""Test end to end construction and search."""
13+
texts = ["foo", "bar", "baz"]

pkgs/development/python-modules/langchain-chroma/default.nix

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
numpy,
88
poetry-core,
99
pytestCheckHook,
10+
pytest-asyncio,
1011
}:
1112

1213
buildPythonPackage rec {
@@ -23,6 +24,8 @@ buildPythonPackage rec {
2324

2425
sourceRoot = "${src.name}/libs/partners/chroma";
2526

27+
patches = [ ./001-async-test.patch ];
28+
2629
build-system = [ poetry-core ];
2730

2831
pythonRelaxDeps = [ "chromadb" ];
@@ -35,7 +38,10 @@ buildPythonPackage rec {
3538

3639
pythonImportsCheck = [ "langchain_chroma" ];
3740

38-
nativeCheckInputs = [ pytestCheckHook ];
41+
nativeCheckInputs = [
42+
pytest-asyncio
43+
pytestCheckHook
44+
];
3945

4046
passthru = {
4147
inherit (langchain-core) updateScript;
@@ -46,6 +52,9 @@ buildPythonPackage rec {
4652
description = "Integration package connecting Chroma and LangChain";
4753
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/chroma";
4854
license = lib.licenses.mit;
49-
maintainers = with lib.maintainers; [ natsukium ];
55+
maintainers = with lib.maintainers; [
56+
natsukium
57+
sarahec
58+
];
5059
};
5160
}

0 commit comments

Comments
 (0)