@@ -198,11 +198,15 @@ def test_jupyter_path():
198
198
def test_jupyter_path_user_site ():
199
199
with no_config_env , patch .object (site , 'ENABLE_USER_SITE' , True ):
200
200
path = jupyter_path ()
201
- sitedir = os .path .join (site .getuserbase (), 'share' , 'jupyter' )
202
- assert path .pop (0 ) == jupyter_data_dir ()
203
- if jupyter_data_dir () != sitedir :
204
- assert path .pop (0 ) == sitedir
205
- assert path .pop (0 ) == paths .ENV_JUPYTER_PATH [0 ]
201
+
202
+ # deduplicated expected values
203
+ values = list (dict .fromkeys ([
204
+ jupyter_data_dir (),
205
+ os .path .join (site .getuserbase (), 'share' , 'jupyter' ),
206
+ paths .ENV_JUPYTER_PATH [0 ]
207
+ ]))
208
+ for p ,v in zip (path , values ):
209
+ assert p == v
206
210
207
211
def test_jupyter_path_no_user_site ():
208
212
with no_config_env , patch .object (site , 'ENABLE_USER_SITE' , False ):
@@ -241,11 +245,14 @@ def test_jupyter_path_subdir():
241
245
def test_jupyter_config_path ():
242
246
with patch .object (site , 'ENABLE_USER_SITE' , True ):
243
247
path = jupyter_config_path ()
244
- sitedir = os .path .join (site .USER_BASE , 'etc' , 'jupyter' )
245
- assert path .pop (0 ) == jupyter_config_dir ()
246
- if jupyter_config_dir () != sitedir :
247
- assert path .pop (0 ) == sitedir
248
- assert path .pop (0 ) == paths .ENV_CONFIG_PATH [0 ]
248
+ # deduplicated expected values
249
+ values = list (dict .fromkeys ([
250
+ jupyter_config_dir (),
251
+ os .path .join (site .USER_BASE , 'etc' , 'jupyter' ),
252
+ paths .ENV_CONFIG_PATH [0 ]
253
+ ]))
254
+ for p ,v in zip (path , values ):
255
+ assert p == v
249
256
250
257
def test_jupyter_config_path_no_user_site ():
251
258
with patch .object (site , 'ENABLE_USER_SITE' , False ):
0 commit comments