o 6a@s(dZddlZddlZddlZddlZddlZddlmZdaiZ ej ej edejjddddejjdddddejd ej ej ed d Zejej er\dndd 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)rrrdatabase derandomizesuppress_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.)addinivalue_line)configr 0/usr/lib/python3/dist-packages/numpy/conftest.pypytest_configure,srcCs|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) addoption)parserr r r pytest_addoption7s  rcCs&|jd}|dur|tjd<dSdS)Navailable_memoryNPY_AVAILABLE_MEM)r getoptionosenviron)session available_memr r r pytest_sessionstartAs rcCs6t}tdur |adS|tkrt|ft|<|adSdS)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)itemmoder r r pytest_itemcollectedHs  r"function)scopeautouseccs\t}dVt}||krtd||t|j}|dur,|\}}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)requestold_modenew_modecollect_resultr r r check_fpu_mode\s" r.)r%cCs t|d<dS)Nnp)numpy)doctest_namespacer r r add_npqs r2cCs|dddS)NPYTHONHASHSEED0)setenv) monkeypatchr r r env_setupusr7)!__doc__rtempfile hypothesispytestr0numpy.core._multiarray_testsrrr configurationset_hypothesis_home_dirpathjoin gettempdirsettingsregister_profile HealthCheckalldirname__file__ _pytest_ini load_profileisfilerrrhookimplr"fixturer.r2r7r r r r sF