B @`@s(dZddlZddlZddlZddlZddlZddlmZdaiZ ej ej edejjddddejjdddddejd ej ej ed d Zejej erdndd d ZddZddZeddZejdddddZejddddZejddddZ dS)z= Pytest configuration and fixtures for the Numpy test suite. N) get_fpu_modez .hypothesisz numpy-profileT)namedeadline print_blobznp.test() profile)rrrZdatabaseZ derandomizeZsuppress_health_checkz..z pytest.inicCs4|dd|dd|dd|dddS)Nmarkersz=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)configr2/tmp/pip-unpacked-wheel-ecq9wray/numpy/conftest.pypytest_configure,sr cCs|jddddddS)Nz--available-memorystorezSet 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.)actiondefaulthelp)Z addoption)parserrrr pytest_addoption7s rcCs"|jd}|dk r|tjd<dS)NZavailable_memoryZNPY_AVAILABLE_MEM)rZ getoptionosenviron)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)itemmoderrr pytest_itemcollectedHs  rfunction)ZscopeautouseccsZt}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)rAssertionErrorformatrgetnode)requestZold_modeZnew_modeZcollect_resultrrr check_fpu_mode\s  r!)rcCs t|d<dS)Nnp)numpy)Zdoctest_namespacerrr add_npqsr$cCs|dddS)NZPYTHONHASHSEED0)Zsetenv)Z monkeypatchrrr env_setupusr&)!__doc__rtempfileZ hypothesisZpytestr#Znumpy.core._multiarray_testsrrr configurationZset_hypothesis_home_dirpathjoin gettempdirsettingsZregister_profileZ HealthCheckalldirname__file__Z _pytest_iniZ load_profileisfiler rrZhookimplrZfixturer!r$r&rrrr s4