;i2:dZddlZddlZddlZddlZddlmZejjZejj Z ejj Z ejj Z ejddgdZ ejddgdZ d efd Zd efd Zd efd ZddZdS)zS Decorators for skipping PyInstaller tests when specific requirements are not met. N)check_requirement pyi_builderonedirT)indirectonefilepackagect|s#tjd|dStjdd|dS)a Skip a decorated test if **package** is not importable. Arguments: package: The name of the module. May be anything that is allowed after the ``import`` keyword. e.g. 'numpy' or 'PIL.Image'. Returns: A pytest marker which either skips the test or does nothing. This function intentionally does not import the module. Doing so can lead to `sys.path` and `PATH` being polluted, which then breaks later builds. zCan't import 'z'.F Don't skip: 'z' is importable.reason) importablepytestmarkskipskipif)rs KC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\PyInstaller/utils/tests.py importorskipr"s] g  >{ < < < <=== ;  e,UG,U,U,U  V VVcddlm}d|vrYt|ddsdSddlm}m}|tjdd|zg||j dkS||duS) Nr) find_spec.F)DEVNULLrunz-czimport )stdoutstderr) importlib.utilrr split subprocessrrsys executable returncode)rrrrs rr r 5s(((((( g~~'--,,Q/00 5++++++++sCND)g*=>wW^___jnooo 9W  T ))r requirementct|r%tjdd|dStjd|dS)a Mark a test to be skipped if **requirement** is not satisfied. Args: requirement: A distribution name and optional version specifier(s). See :func:`PyInstaller.utils.hooks.check_requirement` which this argument is forwarded to. Returns: Either a skip marker or a dummy marker. This function operates on distribution metadata, and does not import any modules. Fr z' is satisfied.r z Requires r)rrrrr)r"s rrequiresr$Es]%%<{!!%0\ 0\0\0\!]]]{ :K : : :;;;rctjdd}|r|dz|z}|dd}||dzz }tj|}||d|S) a Generate a source file for testing. The source will be written into a file named like the test-function. This file will then be passed to `test_script`. If you need other related file, e.g. as `.toc`-file for testing the content, put it at at the normal place. Just mind to take the basnename from the test-function's name. :param script: Source code to create executable from. This will be saved into a temporary file which is then passed on to `test_script`. :param test_id: Test-id for parametrized tests. If given, it will be appended to the script filename, separated by two underscores. __r_z.pyzutf-8)encoding)inspectstackreplacetextwrapdedent write_text)tmp_pathsourcetest_idtestname scriptfiles rgen_sourcefiler6Xs}q!!$H-d?W,S))HX-.J _V $ $F&7333 r)N)__doc__r+rr.rPyInstaller.utils.hooksrr parametrizerxfailr onedir_only onefile_onlystrrr r$r6rrr?s#  555555k%    {k%%mhZ$%OO {&&}ykD&QQ W#WWWW& * * * * * <#<<<<&r