o
    "g3                     @   s*  d Z ddlZddlZddlZddlmZ ddlZddlZddlZddl	Z	ddl
mZ ddlmZ z
ddlmZ dZW n eyE   dZY nw dai Zejeje d	 ejjd
ddd ejjdddddeejd ejejeddZej ej!erd
nd dej"d< dd Z#dd Z$dZ%ere& Z%dd Z'dd Z(e) dd Z*ej+ddddd Z,ej+dd d!d" Z-ej+dd d#d$ Z.ered2d%d&Z/e/e_0ej12d' ej12d( de_3ddl4Z4e4j5e4j6B e_7e	j8j9ej:d)< e;g d*e_<d+d+d,d-d.d/d0e_=g d1e_>dS dS )3z=
Pytest configuration and fixtures for the Numpy test suite.
    N)contextmanager)get_fpu_mode)NOGIL_BUILD)	dt_configTFz.hypothesisznumpy-profile)namedeadline
print_blobznp.test() profile)r   r   r   databasederandomizesuppress_health_checkz..z
pytest.ini1NUMPY_EXPERIMENTAL_DTYPE_APIc                 C   s4   |  dd |  dd |  dd |  dd d S )Nmarkersz=valgrind_error: Tests that are known to error under valgrind.z:leaks_references: Tests that are known to leak references.zslow: Tests that are very slow.z,slow_pypy: Tests that are very slow on pypy.)addinivalue_line)config r   P/var/www/html/ecg_monitoring/venv/lib/python3.10/site-packages/numpy/conftest.pypytest_configure8   s   r   c                 C   s   | j ddd dd d S )Nz--available-memorystorezSet amount of memory available for running the test suite. This can result to tests requiring especially large amounts of memory to be skipped. Equivalent to setting environment variable NPY_AVAILABLE_MEM. Default: determinedautomatically.)actiondefaulthelp)	addoption)parserr   r   r   pytest_addoptionC   s   

r   c                 C   s&   | j d}|d ur|tjd< d S d S )Navailable_memoryNPY_AVAILABLE_MEM)r   	getoptionosenviron)sessionavailable_memr   r   r   pytest_sessionstartR   s   r"   c                 C   s   t rCtsEt rG| }|  |jddddd |d |d |d |d |d	 |d
 |d tjddd d S d S d S d S )NzGIL re-enabled=T)sepredboldz3The GIL was re-enabled at runtime during the tests.z;This can happen with no test failures if the RuntimeWarningz9raised by Python when this happens is filtered by a test. z;Please ensure all new C modules declare support for runningz:without the GIL. Any new tests that intentionally imports z:code that re-enables the GIL should do so in a subprocess.zGIL re-enabled during tests   )
returncode)	r   gil_enabled_at_startsys_is_gil_enabledensure_newlinesectionlinepytestexit)terminalreporter
exitstatusr   trr   r   r   pytest_terminal_summaryX   s   






r5   c                 C   s6   t  }tdu r|adS |tkrt|ft| < |adS dS )z
    Check FPU precision mode was not changed during test collection.

    The clumsy way we do it here is mainly necessary because numpy
    still uses yield tests, which can execute code at test collection
    time.
    N)r   _old_fpu_mode_collect_results)itemmoder   r   r   pytest_itemcollectedg   s   r:   function)scopeautousec                 c   s\    t  }dV  t  }||krtd||t| j}|dur,|\}}td||dS )zC
    Check FPU precision mode was not changed during the test.
    Nz@FPU precision mode changed from {0:#x} to {1:#x} during the testzIFPU precision mode changed from {0:#x} to {1:#x} when collecting the test)r   AssertionErrorformatr7   getnode)requestold_modenew_modecollect_resultr   r   r   check_fpu_mode{   s"   rF   )r=   c                 C   s   t | d< d S )Nnp)numpy)doctest_namespacer   r   r   add_np   s   rJ   c                 C   s   |  dd d S )NPYTHONHASHSEED0)setenv)monkeypatchr   r   r   	env_setup   s   rO   c                 c   sz    g d}d |}ddg}d |}t  tjdt|d tjdt|d dV  W d   dS 1 s6w   Y  dS )z4Filter out the wall of DeprecationWarnings.
        )zThe numpy.linalg.linalgzThe numpy.fft.helperdep_utilpkg_resourcesznumpy.core.umathmsvccompilerzDeprecated callz
numpy.corez`np.compat`zImporting from numpy.matlibzThis function is deprecated.zData type alias 'a'zArrays of 2-dimensional vectorsz`in1d` is deprecated|zinvalid value encounteredzdivide by zero encounteredignore)categorymessageN)joinwarningscatch_warningsfilterwarningsDeprecationWarningRuntimeWarning)testmsgsmsgmsgs_rmsg_rr   r   r   warnings_errors_and_rng   s    


"rb   z#uninitializedz# uninitializedStringDType)znumpy.savezznumpy.matlib.savezznumpy.__array_namespace_info__z%numpy.matlib.__array_namespace_info__r'   zneeds pandasz#errors out in /testing/overrides.pyz(.. testcode:: admonitions not understoodzmanipulates warnings)zhow-to-verify-bug.rstzc-info.ufunc-tutorial.rstzbasics.interoperability.rstzbasics.dispatch.rstzbasics.subclassing.rstzmisc.rst)znumpy/distutilsznumpy/_core/cversions.pyznumpy/_pyinstallerznumpy/random/_examplesznumpy/compatz"numpy/f2py/_backends/_distutils.py)N)?__doc__r   r+   tempfile
contextlibr   rX   
hypothesisr0   rH   numpy._core._multiarray_testsr   numpy.testing._private.utilsr   scipy_doctest.conftestr   
HAVE_SCPDTModuleNotFoundErrorr6   r7   configurationset_hypothesis_home_dirpathrW   
gettempdirsettingsregister_profilelistHealthCheckdirname__file___pytest_iniload_profileisfiler   r   r   r*   r,   r"   r5   hookimplr:   fixturerF   rJ   rO   rb   user_context_mgrrndm_markersaddstrict_checkdoctestNORMALIZE_WHITESPACEELLIPSISoptionflagsdtypesrc   check_namespacesetskiplistpytest_extra_xfailpytest_extra_ignorer   r   r   r   <module>   s    







#	
