U C^ @sdZddlmZmZmZddlZddlZddlZddlm Z da iZ ddZ ddZ d d Zed d Zejd ddddZejddddZdS)z= Pytest configuration and fixtures for the Numpy test suite. )divisionabsolute_importprint_functionN) get_fpu_modecCs(|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.)Zaddinivalue_line)configr1/tmp/pip-install-6_kvzl1k/numpy/numpy/conftest.pypytest_configuresr 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_addoptions rcCs"|jd}|dk r|tjd<dS)NZavailable_memoryZNPY_AVAILABLE_MEM)rZ getoptionosenviron)sessionZ available_memrrr pytest_sessionstart%s 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_itemcollected,s  rfunctionT)scopeautouseccsZt}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_npUsr%)__doc__ __future__rrrrZpytestr$Znumpy.core._multiarray_testsrrrr rrZhookimplrZfixturer"r%rrrr s