File tree Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -64,23 +64,25 @@ def fixture_vcr_config() -> dict[str, Any]:
64
64
}
65
65
66
66
67
- @pytest .fixture
68
- def tmp_path_cleanup (tmp_path : Path ) -> Iterator [Path ]:
67
+ @pytest .fixture ( name = "tmp_path_cleanup" )
68
+ def fixture_tmp_path_cleanup (tmp_path : Path ) -> Iterator [Path ]:
69
69
yield tmp_path
70
70
# Cleanup after the test
71
71
if tmp_path .exists ():
72
72
shutil .rmtree (tmp_path , ignore_errors = True )
73
73
74
74
75
- @pytest .fixture
76
- def agent_home_dir (tmp_path_cleanup : str | os .PathLike ) -> Iterator [str | os .PathLike ]:
75
+ @pytest .fixture (name = "agent_home_dir" )
76
+ def fixture_agent_home_dir (
77
+ tmp_path_cleanup : str | os .PathLike ,
78
+ ) -> Iterator [str | os .PathLike ]:
77
79
"""Set up a unique temporary folder for the agent module."""
78
80
with patch .dict ("os.environ" , {"PQA_HOME" : str (tmp_path_cleanup )}):
79
81
yield tmp_path_cleanup
80
82
81
83
82
- @pytest .fixture
83
- def agent_index_dir (agent_home_dir : Path ) -> Path :
84
+ @pytest .fixture ( name = "agent_index_dir" )
85
+ def fixture_agent_index_dir (agent_home_dir : Path ) -> Path :
84
86
return agent_home_dir / ".pqa" / "indexes"
85
87
86
88
Original file line number Diff line number Diff line change 66
66
THIS_MODULE = pathlib .Path (__file__ )
67
67
68
68
69
- @pytest_asyncio .fixture
70
- async def docs_fixture (stub_data_dir : Path ) -> Docs :
69
+ @pytest_asyncio .fixture ( name = "docs_fixture" )
70
+ async def fixture_docs_fixture (stub_data_dir : Path ) -> Docs :
71
71
docs = Docs ()
72
72
with (stub_data_dir / "paper.pdf" ).open ("rb" ) as f :
73
73
await docs .aadd_file (f , "Wellawatte et al, XAI Review, 2023" )
@@ -929,12 +929,6 @@ async def test_repeat_keys(stub_data_dir) -> None:
929
929
assert ds [1 ].docname == "Wiki2023a"
930
930
931
931
932
- @pytest .mark .asyncio
933
- async def test_can_read_normal_pdf_reader (docs_fixture ) -> None :
934
- answer = await docs_fixture .aquery ("Are counterfactuals actionable? [yes/no]" )
935
- assert "yes" in answer .answer or "Yes" in answer .answer
936
-
937
-
938
932
@pytest .mark .asyncio
939
933
async def test_pdf_reader_w_no_match_doc_details (stub_data_dir : Path ) -> None :
940
934
docs = Docs ()
@@ -1088,8 +1082,8 @@ async def test_pdf_reader_match_doc_details(stub_data_dir: Path) -> None:
1088
1082
1089
1083
@pytest .mark .asyncio
1090
1084
async def test_fileio_reader_pdf (stub_data_dir : Path ) -> None :
1085
+ docs = Docs ()
1091
1086
with (stub_data_dir / "paper.pdf" ).open ("rb" ) as f :
1092
- docs = Docs ()
1093
1087
await docs .aadd_file (f , "Wellawatte et al, XAI Review, 2023" )
1094
1088
num_retries = 3
1095
1089
for _ in range (num_retries ):
You can’t perform that action at this time.
0 commit comments