Commit c630d9a 1 parent d1d78e2 commit c630d9a Copy full SHA for c630d9a
File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,12 @@ def test_openalex_id_backward(tmpdir):
122
122
email = EMAIL ,
123
123
)
124
124
df = pd .read_csv (out_fp )
125
- assert len (df ) == 40
125
+ # Actual value at time of writing test is 40 (2024-08-26).
126
+ # In theory the number of results should be stable for backward snowballing,
127
+ # but OpenAlex sometimes makes changes, so we allow for a margin.
128
+ # The margins of this assert and the next assert should not overlap,
129
+ # otherwise we don't test if 'use_all' works.
130
+ assert 38 <= len (df ) <= 42
126
131
127
132
all_out_fp = Path (tmpdir , "backward_all.csv" )
128
133
snowball (
@@ -134,7 +139,8 @@ def test_openalex_id_backward(tmpdir):
134
139
email = EMAIL ,
135
140
)
136
141
df_all = pd .read_csv (all_out_fp )
137
- assert len (df_all ) == 45
142
+ # Actual value at time of writing test is 46 (2024-08-26).
143
+ assert 43 <= len (df_all ) <= 49
138
144
139
145
140
146
def test_snowballing_from_doi (tmpdir ):
@@ -148,4 +154,6 @@ def test_snowballing_from_doi(tmpdir):
148
154
email = EMAIL ,
149
155
)
150
156
df = pd .read_csv (out_fp )
151
- assert len (df ) == 45
157
+ # Actual value at time of writing test is 46 (2024-08-26).
158
+ # See comments in 'test_openalex_id_backward'.
159
+ assert 43 <= len (df ) <= 49
You can’t perform that action at this time.
0 commit comments