Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
conftest.cpython-313.pyc76 linesDownload Raw Back to __pycache__
1�

2�jv
���SSKrSSKrSSKrSSKrSSKrSSKJr SSKJrJ	r	 SSK3r4SSKr\5R"5S5r
"SS5r\6R"SSS	9S7\\SS44Sj5r\8R"SS9S
5rg)�N)�deque)�	Generator�Sequencec#�&# �[R"S5nURR5 URR5 URRS5 Uv� URR5 URR5 URRS5 g!URR5 URR5 URRS5 f=f7f)z(9Fixture providing a memory filesystem.10�memory�N)�fsspec�11filesystem�store�clear�pseudo_dirs�append)�ms �UD:\code\apps\devtools\python\user_packages\Python313\site-packages\fsspec/conftest.pyrrs����12	���(�#�A��G�G�M�M�O��M�M�����M�M�����!���	���
�
��	�
�
����	�
�
���R� ��	13���
�
��	�
�
����	�
�
���R� �s �A&D�)B=�-AD�=AD�Dc�F�\rSrSrSrSSjrSS.S\S\\\	44S	jjr14S15rg)�InstanceCacheInspector�zI16Helper class to inspect instance caches of filesystem classes in tests.17�returnNc���[[RR/5nU(aIUR	5nUR5 UR
UR55 U(aMHgg)zE18Clear instance caches of all currently imported filesystem classes.19N)rr	�spec�AbstractFileSystem�popleft�clear_instance_cache�extend�__subclasses__)�self�classes�clss   rr�InstanceCacheInspector.clear$sR������7�7�8�9����/�/�#�C��$�$�&��N�N�3�-�-�/�0��g�T)�	omit_zeror!c���0n[[RR/5nU(a�UR	5n[UR5n[UR[[45(aL[UR[5(aUROURSnU(dU(dXRU'URUR55 U(aM�U$)z�20Gather counts of filesystem instances in the instance caches21of all currently imported filesystem classes.22 23Parameters24----------25omit_zero:26    Whether to omit instance types with no cached instances.27r)
rr	rrr�len�_cache�28isinstance�protocolr�strrr)rr!�outrr�count�keys       r�
gather_counts�$InstanceCacheInspector.gather_counts.s���!������7�7�8�9����/�/�#�C���29�30�O�E��#�,�,��3��8�8�&0����s�&C�&C�c�l�l����VW����	�$��H��N�N�3�-�-�/�0��g��31r �)rN)�__name__�32__module__�__qualname__�__firstlineno__�__doc__r�bool�dictr'�intr+�__static_attributes__r-r rrrs1���1�26��$��$�s�C�x�.��r r�functionT)�scope�autouserc#�# �[5nUR5 Uv� UR5 g!UR5 f=f7f)a733Fixture to ensure empty filesystem instance caches before and after a test.34 35Used by default for all tests.36Clears caches of all imported filesystem classes.37Can be used to write test assertions about instance caches.38 39Usage:40 41    def test_something(instance_caches):42        # Test code here43        fsspec.open("file://abc")44        fsspec.open("memory://foo/bar")45 46        # Test assertion47        assert instance_caches.gather_counts() == {"file": 1, "memory": 1}48 49Returns50-------51instance_caches: An instance cache inspector for clearing and inspecting caches.52N)rr)�ics r�instance_cachesr<Gs4���.53 �	!�B��H�H�J����54���55�����56�s�A�3�A�A�A)r8c#�# �[R"S5 [U5n[[R57R
US5S5nURSS-5 SSS5 [R"[RSSSUS	S58SSS
/595n[R"S5 Sv� UR5 UR5 [ R""U5 g!,(df   N�=f![$a gf=f!UR5 UR5 [ R""U5 f![$a ff=f=f7f)z.60Fixture providing a writable FTP filesystem.61�	pyftpdlibr(�wbshelloi'Nz-mz-dz-u�userz-P�passz-w�)�	localhostiIr@rA)�pytest�importorskipr'�open�os�path�join�write�62subprocess�Popen�sys�63executable�time�sleep�	terminate�wait�shutil�rmtree�	Exception)�tmpdir�d�f�Ps    r�ftp_writablerZgs���64����$��F��A�	
�b�g�g�l�l�1�e�$�d�	+�q�	����5� �!�65,����	����{�D�!�T�6�4��QU�V�	�A�	��66�67�1�
�/�/�	���
�	����	��M�M�&�!�68,�	+���	��	��		69���
�	����	��M�M�&�!���	��	�s~�AE�C,�#6E�D
�4 E�C=�+E�,70C:�6E�=71D72�E�	D73�74E�
!E�/E�E�75E�E�E�E�E)rGrSrKrMrO�collectionsr�collections.abcrrrDr	�fixturerrr<rZr-r r�<module>r^s���	�
��76���/�
�
�����
!��
!� %�%�P���j�$�/���#9�4��#E�F��0��>���j�!��"�r 
codekingpro/portable-devtools · Team Ai