1- import os
21import sys
32
43import pytest
98if sys .version_info [:2 ] != (3 , 12 ):
109 pytest .skip ("Too many tests bust rate limit" , allow_module_level = True )
1110
12- token = os .getenv ("GH_TOKEN" , None )
13-
1411
1512@pytest .mark .parametrize (
1613 "gist_id,sha" ,
17- [("2656908684d3965b80c2 " , "2fb2f12f332f7e242b1a2af1f41e30ddf99f24c7" )],
14+ [("d5d7b521d0e5fec8adfc5652b8f3242c " , None )],
1815)
1916def test_gist_public_all_files (gist_id , sha ):
20- fs = fsspec .filesystem ("gist" , gist_id = gist_id , sha = sha , token = token )
17+ fs = fsspec .filesystem ("gist" , gist_id = gist_id , sha = sha )
2118 # Listing
2219 all_files = fs .ls ("" )
2320 assert len (all_files ) == 2
@@ -32,16 +29,14 @@ def test_gist_public_all_files(gist_id, sha):
3229 "gist_id,sha,file" ,
3330 [
3431 (
35- "2656908684d3965b80c2 " ,
36- "2fb2f12f332f7e242b1a2af1f41e30ddf99f24c7" ,
37- "distributed_error_logs_PY3_7-3-2016 " ,
32+ "d5d7b521d0e5fec8adfc5652b8f3242c " ,
33+ None ,
34+ "ex1.ipynb " ,
3835 )
3936 ],
4037)
4138def test_gist_public_one_file (gist_id , sha , file ):
42- fs = fsspec .filesystem (
43- "gist" , gist_id = gist_id , sha = sha , filenames = [file ], token = token
44- )
39+ fs = fsspec .filesystem ("gist" , gist_id = gist_id , sha = sha , filenames = [file ])
4540 # Listing
4641 all_files = fs .ls ("" )
4742 assert len (all_files ) == 1
@@ -57,16 +52,14 @@ def test_gist_public_one_file(gist_id, sha, file):
5752 [
5853 (
5954 "2656908684d3965b80c2" ,
60- "2fb2f12f332f7e242b1a2af1f41e30ddf99f24c7 " ,
55+ "d5d7b521d0e5fec8adfc5652b8f3242c " ,
6156 "file-that-doesnt-exist.py" ,
6257 )
6358 ],
6459)
6560def test_gist_public_missing_file (gist_id , sha , file ):
6661 with pytest .raises (FileNotFoundError ):
67- fsspec .filesystem (
68- "gist" , gist_id = gist_id , sha = sha , filenames = [file ], token = token
69- )
62+ fsspec .filesystem ("gist" , gist_id = gist_id , sha = sha , filenames = [file ])
7063
7164
7265@pytest .mark .parametrize (
0 commit comments