B z `H@sdZddlZddlZddlZddlZddlZddlmZdaiZ ej ej edejjddddyejdWn$ejjk rejdYnXd d Zd d Zd dZeddZejdddddZejddddZdS)z= Pytest configuration and fixtures for the Numpy test suite. N) get_fpu_modez .hypothesisz numpy-profileT)namedeadlineZ print_blobznp.test() profilecCs4|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-4iou4664/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)parserrrrpytest_addoption/s rcCs"|jd}|dk r|tjd<dS)NZavailable_memoryZNPY_AVAILABLE_MEM)rZ getoptionosenviron)sessionZ available_memrrrpytest_sessionstart9s 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)itemmoderrrpytest_itemcollected@s  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_resultrrrcheck_fpu_modeTs  r )rcCs t|d<dS)Nnp)numpy)Zdoctest_namespacerrradd_npisr#)__doc__rtempfileZ hypothesisZpytestr"Znumpy.core._multiarray_testsrrr configurationZset_hypothesis_home_dirpathjoin gettempdirsettingsZregister_profileZ load_profileerrorsZInvalidArgumentr rrZhookimplrZfixturer r#rrrrs,