zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
U
O±d8ã@s@dZddlZddlZddlZddlZddlZddlmZdaiZ    ej
  ej   e ¡d¡¡ejjddddejjdddddeejƒd    ej   ej  e¡d
d ¡Zej ej  e¡r¸dnd¡d d „Zdd„Zdd„Ze ¡dd„ƒZejddddd„ƒZejdddd„ƒZejdddd„ƒZ ejddgddd „ƒZ!dS)!z=
Pytest configuration and fixtures for the Numpy test suite.
éN)Ú get_fpu_modez .hypothesisz numpy-profileT)ÚnameÚdeadlineÚ
print_blobznp.test() profile)rrrZdatabaseZ derandomizeZsuppress_health_checkz..z
pytest.inicCs4| dd¡| dd¡| dd¡| dd¡dS)NÚmarkersz=valgrind_error: Tests that are known to error under valgrind.z:leaks_references: Tests that are known to leak references.zslow: Tests that are very slow.z,slow_pypy: Tests that are very slow on pypy.)Zaddinivalue_line)Úconfig©rúEd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/conftest.pyÚpytest_configure,sÿÿÿÿr
cCs|jddddddS)Nz--available-memoryÚstorezïSet 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)Z    addoption)Úparserrrr    Úpytest_addoption7s
ÿrcCs"|j d¡}|dk    r|tjd<dS)NZavailable_memoryZNPY_AVAILABLE_MEM)rZ    getoptionÚosÚenviron)ÚsessionZ available_memrrr    Úpytest_sessionstartAs rcCs0tƒ}tdkr|an|tkr,t|ft|<|adS)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Úmoderrr    Úpytest_itemcollectedHs  rÚfunction)ZscopeÚautouseccsZtƒ}dVtƒ}||kr*td ||¡ƒ‚t |j¡}|dk    rV|\}}td ||¡ƒ‚dS)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ÚformatrÚgetÚnode)ÚrequestZold_modeZnew_modeZcollect_resultrrr    Úcheck_fpu_mode\sÿ þr!)rcCs t|d<dS)NÚnp)Únumpy)Zdoctest_namespacerrr    Úadd_npqsr$cCs| dd¡dS)NZPYTHONHASHSEEDÚ0)Zsetenv)Z monkeypatchrrr    Ú    env_setupusr&F)Úparamsccs:t ¡}|jrt d¡n
t d¡|jVt |¡dS)z·
    Fixture to ensure "legacy" promotion state or change it to use the new
    weak promotion (plus warning).  `old_promotion` should be used as a
    parameter in the function.
    Z weak_and_warnÚlegacyN)r#Z_get_promotion_stateÚparamZ_set_promotion_state)r Ústaterrr    Úweak_promotionzs  
r+)"Ú__doc__rÚtempfileZ
hypothesisZpytestr#Znumpy.core._multiarray_testsrrrÚ configurationZset_hypothesis_home_dirÚpathÚjoinÚ
gettempdirÚsettingsZregister_profileÚlistZ HealthCheckÚdirnameÚ__file__Z _pytest_iniZ load_profileÚisfiler
rrZhookimplrZfixturer!r$r&r+rrrr    Ú<module>sR ÿÿýÿ