99pytestmark = [pytest .mark .integration , pytest .mark .asyncio ]
1010
1111
12- async def test_dedupe_returns_table_with_equivalence_fields (papers_df ):
12+ async def test_dedupe_returns_table_with_equivalence_fields (papers_df , session ):
1313 """Test that dedupe returns a TableResult with equivalence class fields."""
1414 result = await dedupe (
1515 equivalence_relation = """
@@ -18,6 +18,7 @@ async def test_dedupe_returns_table_with_equivalence_fields(papers_df):
1818 are considered duplicates.
1919 """ ,
2020 input = papers_df ,
21+ session = session ,
2122 )
2223
2324 assert isinstance (result , TableResult )
@@ -26,7 +27,7 @@ async def test_dedupe_returns_table_with_equivalence_fields(papers_df):
2627 assert "selected" in result .data .columns
2728
2829
29- async def test_dedupe_identifies_duplicates (papers_df ):
30+ async def test_dedupe_identifies_duplicates (papers_df , session ):
3031 """Test that dedupe correctly identifies duplicate papers."""
3132 result = await dedupe (
3233 equivalence_relation = """
@@ -35,6 +36,7 @@ async def test_dedupe_identifies_duplicates(papers_df):
3536 "Attention Is All You Need" appears twice - once as NeurIPS and once as arXiv.
3637 """ ,
3738 input = papers_df ,
39+ session = session ,
3840 )
3941
4042 assert isinstance (result , TableResult )
@@ -53,7 +55,7 @@ async def test_dedupe_identifies_duplicates(papers_df):
5355 assert attention_class != bert_class
5456
5557
56- async def test_dedupe_selects_one_per_class ():
58+ async def test_dedupe_selects_one_per_class (session ):
5759 """Test that dedupe marks exactly one entry as selected per equivalence class."""
5860 input_df = pd .DataFrame (
5961 [
@@ -69,6 +71,7 @@ async def test_dedupe_selects_one_per_class():
6971 "Paper A - Preprint" and "Paper A - Published" are the same paper.
7072 """ ,
7173 input = input_df ,
74+ session = session ,
7275 )
7376
7477 assert isinstance (result , TableResult )
@@ -82,7 +85,7 @@ async def test_dedupe_selects_one_per_class():
8285 )
8386
8487
85- async def test_dedupe_unique_items_all_selected ():
88+ async def test_dedupe_unique_items_all_selected (session ):
8689 """Test that unique (non-duplicate) items each get their own class and are selected."""
8790 input_df = pd .DataFrame (
8891 [
@@ -95,6 +98,7 @@ async def test_dedupe_unique_items_all_selected():
9598 result = await dedupe (
9699 equivalence_relation = "Items are duplicates only if they are the exact same fruit name." ,
97100 input = input_df ,
101+ session = session ,
98102 )
99103
100104 assert isinstance (result , TableResult )
@@ -104,7 +108,7 @@ async def test_dedupe_unique_items_all_selected():
104108 assert result .data ["selected" ].all () # pyright: ignore[reportGeneralTypeIssues]
105109
106110
107- async def test_dedupe_identify_strategy_no_selection ():
111+ async def test_dedupe_identify_strategy_no_selection (session ):
108112 """Test that identify strategy clusters but does not add a 'selected' column."""
109113 input_df = pd .DataFrame (
110114 [
@@ -121,6 +125,7 @@ async def test_dedupe_identify_strategy_no_selection():
121125 """ ,
122126 input = input_df ,
123127 strategy = "identify" ,
128+ session = session ,
124129 )
125130
126131 assert isinstance (result , TableResult )
@@ -129,7 +134,7 @@ async def test_dedupe_identify_strategy_no_selection():
129134 assert "selected" not in result .data .columns
130135
131136
132- async def test_dedupe_combine_strategy_creates_combined_rows ():
137+ async def test_dedupe_combine_strategy_creates_combined_rows (session ):
133138 """Test that combine strategy produces combined rows marked as selected."""
134139 input_df = pd .DataFrame (
135140 [
@@ -146,6 +151,7 @@ async def test_dedupe_combine_strategy_creates_combined_rows():
146151 """ ,
147152 input = input_df ,
148153 strategy = "combine" ,
154+ session = session ,
149155 )
150156
151157 assert isinstance (result , TableResult )
@@ -157,7 +163,7 @@ async def test_dedupe_combine_strategy_creates_combined_rows():
157163 assert len (selected_rows ) >= 1
158164
159165
160- async def test_dedupe_select_strategy_explicit ():
166+ async def test_dedupe_select_strategy_explicit (session ):
161167 """Test that explicitly passing strategy='select' works the same as the default."""
162168 input_df = pd .DataFrame (
163169 [
@@ -170,6 +176,7 @@ async def test_dedupe_select_strategy_explicit():
170176 equivalence_relation = "Items are duplicates only if they are the exact same fruit name." ,
171177 input = input_df ,
172178 strategy = "select" ,
179+ session = session ,
173180 )
174181
175182 assert isinstance (result , TableResult )
@@ -179,7 +186,7 @@ async def test_dedupe_select_strategy_explicit():
179186 assert result .data ["selected" ].all () # pyright: ignore[reportGeneralTypeIssues]
180187
181188
182- async def test_dedupe_with_strategy_prompt ():
189+ async def test_dedupe_with_strategy_prompt (session ):
183190 """Test that strategy_prompt parameter is accepted."""
184191 input_df = pd .DataFrame (
185192 [
@@ -197,6 +204,7 @@ async def test_dedupe_with_strategy_prompt():
197204 input = input_df ,
198205 strategy = "select" ,
199206 strategy_prompt = "Always prefer the published version over the preprint." ,
207+ session = session ,
200208 )
201209
202210 assert isinstance (result , TableResult )
0 commit comments