ְ߂4dZddlZddlZddlZddlmZddlmZmZ ddlm Z n #e $rdZ YnwxYwej eej eej ee ej e ej dZej dd Zej d d Zej d d ZejddZejdddZejddZdS)zA pytest plugin for using pyfakefs as a fixture When pyfakefs is installed, the "fs" fixture becomes available. :Usage: def my_fakefs_test(fs): fs.create_file('/var/data/xx1.txt') assert os.path.exists('/var/data/xx1.txt') N)capture)PatcherPause)pathlibc#Kt|drt|j}nt}||jV|dS)zFake filesystem.paramNhasattrrrsetUpfstearDownrequestpatchers h/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pyfakefs/pytest_plugin.pyr r sdw  7=))) MMOOO * class)scopec#Kt|drt|j}nt}||jV|dS)z%Class-scoped fake filesystem fixture.rNr rs rfs_classr-dw  7=))) MMOOO * rmodulec#Kt|drt|j}nt}||jV|dS)z&Module-scoped fake filesystem fixture.rNr rs r fs_moduler9rrsessionc#Kt|drt|j}nt}||jV|dS)z'Session-scoped fake filesystem fixture.rNr rs r fs_sessionrErrT)tryfirstc,tjdS)zCMake sure that the cache is cleared before the final test shutdown.N)rclear_fs_cache)r exitstatuss rpytest_sessionfinishr"Qs r) hookwrapperrc#>Ktjduotjj}|rttjnt j}|5dVdddn #1swxYwY|r+|jdkr"tjdSdSdS)z7Make sure that patching is not active during reporting.Nteardown)rPATCHER is_patchingr contextlib nullcontextwhenpause)reportr+ context_mgrs rpytest_runtest_logreportr.Ws O4 ' GGO,GE,1O%(((z7M7O7OK     **   **sA##A'*A'c^tj tjdSdS)N)rr&resume)items rpytest_runtest_setupr2ds."     #"r)__doc__r(pypytest_pytestr!pyfakefs.fake_filesystem_unittestrrr ImportError SKIPMODULESaddfixturer rrrhookimplr"r.r2rrr>s&   <<<<<<<<GGG   G$$$   gh i   ! $  TD111   21  $!! !!!s %//