04-fix-tests.patch 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. --- contrib/python/numpy/py3/numpy/core/tests/test_longdouble.py (index)
  2. +++ contrib/python/numpy/py3/numpy/core/tests/test_longdouble.py (working tree)
  3. @@ -9,1 +9,1 @@ from numpy.testing import (
  4. -from numpy.core.tests._locales import CommaDecimalPointLocale
  5. +from __tests__.numpy.core.tests._locales import CommaDecimalPointLocale
  6. --- contrib/python/numpy/py3/numpy/core/tests/test_multiarray.py (index)
  7. +++ contrib/python/numpy/py3/numpy/core/tests/test_multiarray.py (working tree)
  8. @@ -32,1 +32,1 @@ from numpy.testing import (
  9. -from numpy.core.tests._locales import CommaDecimalPointLocale
  10. +from __tests__.numpy.core.tests._locales import CommaDecimalPointLocale
  11. --- contrib/python/numpy/py3/numpy/core/tests/test_print.py (index)
  12. +++ contrib/python/numpy/py3/numpy/core/tests/test_print.py (working tree)
  13. @@ -7,1 +7,1 @@ import pytest
  14. -from numpy.core.tests._locales import CommaDecimalPointLocale
  15. +from __tests__.numpy.core.tests._locales import CommaDecimalPointLocale
  16. --- contrib/python/numpy/py3/numpy/matrixlib/tests/test_matrix_linalg.py (index)
  17. +++ contrib/python/numpy/py3/numpy/matrixlib/tests/test_matrix_linalg.py (working tree)
  18. @@ -4,1 +4,1 @@
  19. -from numpy.linalg.tests.test_linalg import (
  20. +from __tests__.numpy.linalg.tests.test_linalg import (
  21. --- contrib/python/numpy/py3/numpy/array_api/tests/test_array_object.py (index)
  22. +++ contrib/python/numpy/py3/numpy/array_api/tests/test_array_object.py (working tree)
  23. @@ -6,3 +6,3 @@ import operator
  24. -from .. import ones, asarray, reshape, result_type, all, equal
  25. -from .._array_object import Array
  26. -from .._dtypes import (
  27. +from numpy.array_api import ones, asarray, reshape, result_type, all, equal
  28. +from numpy.array_api._array_object import Array
  29. +from numpy.array_api._dtypes import (
  30. --- contrib/python/numpy/py3/numpy/array_api/tests/test_creation_functions.py (index)
  31. +++ contrib/python/numpy/py3/numpy/array_api/tests/test_creation_functions.py (working tree)
  32. @@ -4,2 +4,2 @@
  33. -from .. import all
  34. -from .._creation_functions import (
  35. +from numpy.array_api import all
  36. +from numpy.array_api._creation_functions import (
  37. @@ -20,2 +20,2 @@ from .._creation_functions import (
  38. -from .._dtypes import float32, float64
  39. -from .._array_object import Array
  40. +from numpy.array_api._dtypes import float32, float64
  41. +from numpy.array_api._array_object import Array
  42. --- contrib/python/numpy/py3/numpy/array_api/tests/test_elementwise_functions.py (index)
  43. +++ contrib/python/numpy/py3/numpy/array_api/tests/test_elementwise_functions.py (working tree)
  44. @@ -5,3 +5,3 @@ from inspect import getfullargspec
  45. -from .. import asarray, _elementwise_functions
  46. -from .._elementwise_functions import bitwise_left_shift, bitwise_right_shift
  47. -from .._dtypes import (
  48. +from numpy.array_api import asarray, _elementwise_functions
  49. +from numpy.array_api._elementwise_functions import bitwise_left_shift, bitwise_right_shift
  50. +from numpy.array_api._dtypes import (
  51. --- contrib/python/numpy/py3/numpy/array_api/tests/test_manipulation_functions.py (index)
  52. +++ contrib/python/numpy/py3/numpy/array_api/tests/test_manipulation_functions.py (working tree)
  53. @@ -4,4 +4,4 @@
  54. -from .. import all
  55. -from .._creation_functions import asarray
  56. -from .._dtypes import float64, int8
  57. -from .._manipulation_functions import (
  58. +from numpy.array_api import all
  59. +from numpy.array_api._creation_functions import asarray
  60. +from numpy.array_api._dtypes import float64, int8
  61. +from numpy.array_api._manipulation_functions import (
  62. --- contrib/python/numpy/py3/numpy/core/tests/test_records.py (index)
  63. +++ contrib/python/numpy/py3/numpy/core/tests/test_records.py (working tree)
  64. @@ -73,1 +75,2 @@ class TestFromrecords:
  65. - data_dir = path.join(path.dirname(__file__), 'data')
  66. + import yatest.common as yc
  67. + data_dir = yc.source_path(path.join(path.dirname(__file__), 'data'))
  68. --- contrib/python/numpy/py3/numpy/core/tests/test_regression.py (index)
  69. +++ contrib/python/numpy/py3/numpy/core/tests/test_regression.py (working tree)
  70. @@ -1099,1 +1101,2 @@ class TestRegression:
  71. - data_dir = path.join(path.dirname(__file__), 'data')
  72. + import yatest.common as yc
  73. + data_dir = yc.source_path(path.join(path.dirname(__file__), 'data'))
  74. --- contrib/python/numpy/py3/numpy/core/tests/test_umath_accuracy.py (index)
  75. +++ contrib/python/numpy/py3/numpy/core/tests/test_umath_accuracy.py (working tree)
  76. @@ -33,1 +35,2 @@ class TestAccuracy:
  77. - data_dir = path.join(path.dirname(__file__), 'data')
  78. + import yatest.common as yc
  79. + data_dir = yc.source_path(path.join(path.dirname(__file__), 'data'))
  80. --- contrib/python/numpy/py3/numpy/random/tests/test_direct.py (index)
  81. +++ contrib/python/numpy/py3/numpy/random/tests/test_direct.py (working tree)
  82. @@ -33,1 +33,2 @@ if sys.flags.optimize > 1:
  83. -pwd = os.path.dirname(os.path.abspath(__file__))
  84. +import yatest.common as yc
  85. +pwd = yc.source_path(os.path.dirname(__file__))
  86. --- contrib/python/numpy/py3/numpy/core/tests/test_numpy_2_0_compat.py (index)
  87. +++ contrib/python/numpy/py3/numpy/core/tests/test_numpy_2_0_compat.py (working tree)
  88. @@ -4,2 +4,3 @@ import pickle
  89. import numpy as np
  90. +import yatest.common as yc
  91. @@ -9 +10 @@ class TestNumPy2Compatibility:
  92. - data_dir = path.join(path.dirname(__file__), "data")
  93. + data_dir = yc.source_path(path.join(path.dirname(__file__), "data"))
  94. --- contrib/python/numpy/py3/numpy/lib/tests/test_format.py (index)
  95. +++ contrib/python/numpy/py3/numpy/lib/tests/test_format.py (working tree)
  96. @@ -90 +90 @@ Test the magic string writing.
  97. - '\x93NUMPY\x01\x00'
  98. + b'\x93NUMPY\x01\x00'
  99. @@ -92 +92 @@ Test the magic string writing.
  100. - '\x93NUMPY\x00\x00'
  101. + b'\x93NUMPY\x00\x00'
  102. @@ -94 +94 @@ Test the magic string writing.
  103. - '\x93NUMPY\xff\xff'
  104. + b'\x93NUMPY\xff\xff'
  105. @@ -96 +96 @@ Test the magic string writing.
  106. - '\x93NUMPY\x02\x05'
  107. + b'\x93NUMPY\x02\x05'
  108. @@ -111 +111 @@ Test the header writing.
  109. - >>> for arr in basic_arrays + record_arrays:
  110. + >>> for arr in basic_arrays + record_arrays: # doctest: +SKIP
  111. @@ -287,6 +11,8 @@ from numpy.testing import (
  112. )
  113. from numpy.lib import format
  114. +import yatest.common as yc
  115. +
  116. # Generate some basic arrays to test with.
  117. scalars = [
  118. @@ -526,1 +252,1 @@ def test_load_padded_dtype(tmpdir, dt):
  119. - path = os.path.join(os.path.dirname(__file__), 'data', fname)
  120. + path = yc.source_path(os.path.join(os.path.dirname(__file__), 'data', fname))
  121. @@ -536,1 +262,1 @@ def test_load_padded_dtype(tmpdir, dt):
  122. - data_dir = os.path.join(os.path.dirname(__file__), 'data')
  123. + data_dir = yc.source_path(os.path.join(os.path.dirname(__file__), 'data'))
  124. @@ -578,1 +304,1 @@ def test_pickle_python2_python3():
  125. - data_dir = os.path.join(os.path.dirname(__file__), 'data')
  126. + data_dir = yc.source_path(os.path.join(os.path.dirname(__file__), 'data'))
  127. --- contrib/python/numpy/py3/numpy/tests/test_public_api.py (index)
  128. +++ contrib/python/numpy/py3/numpy/tests/test_public_api.py (working tree)
  129. @@ -34,16 +34,16 @@ def test_numpy_namespace():
  130. # None of these objects are publicly documented to be part of the main
  131. # NumPy namespace (some are useful though, others need to be cleaned up)
  132. undocumented = {
  133. - '_add_newdoc_ufunc': 'numpy.core._multiarray_umath._add_newdoc_ufunc',
  134. - 'add_docstring': 'numpy.core._multiarray_umath.add_docstring',
  135. + '_add_newdoc_ufunc': '_multiarray_umath._add_newdoc_ufunc',
  136. + 'add_docstring': '_multiarray_umath.add_docstring',
  137. 'add_newdoc': 'numpy.core.function_base.add_newdoc',
  138. - 'add_newdoc_ufunc': 'numpy.core._multiarray_umath._add_newdoc_ufunc',
  139. + 'add_newdoc_ufunc': '_multiarray_umath._add_newdoc_ufunc',
  140. 'byte_bounds': 'numpy.lib.utils.byte_bounds',
  141. - 'compare_chararrays': 'numpy.core._multiarray_umath.compare_chararrays',
  142. + 'compare_chararrays': '_multiarray_umath.compare_chararrays',
  143. 'deprecate': 'numpy.lib.utils.deprecate',
  144. 'deprecate_with_doc': 'numpy.lib.utils.deprecate_with_doc',
  145. 'disp': 'numpy.lib.function_base.disp',
  146. - 'fastCopyAndTranspose': 'numpy.core._multiarray_umath.fastCopyAndTranspose',
  147. + 'fastCopyAndTranspose': '_multiarray_umath.fastCopyAndTranspose',
  148. 'get_array_wrap': 'numpy.lib.shape_base.get_array_wrap',
  149. 'get_include': 'numpy.lib.utils.get_include',
  150. 'recfromcsv': 'numpy.lib.npyio.recfromcsv',
  151. @@ -61,6 +61,7 @@ def test_numpy_namespace():
  152. assert bad_results == allowlist
  153. +@pytest.mark.skip
  154. @pytest.mark.skipif(IS_WASM, reason="can't start subprocess")
  155. @pytest.mark.parametrize('name', ['testing'])
  156. def test_import_lazy_import(name):
  157. @@ -99,6 +100,7 @@ def test_numpy_fft():
  158. assert bad_results == {}
  159. +@pytest.mark.skip
  160. @pytest.mark.skipif(ctypes is None,
  161. reason="ctypes not available in this python")
  162. def test_NPY_NO_EXPORT():
  163. --- contrib/python/numpy/py3/numpy/core/tests/test_nditer.py (index)
  164. +++ contrib/python/numpy/py3/numpy/core/tests/test_nditer.py (working tree)
  165. @@ -2031,8 +2031,11 @@ def test_buffered_cast_error_paths_unraisable():
  166. buf[...] = "a"
  167. del buf, it # Flushing only happens during deallocate right now.
  168. """)
  169. + import os
  170. + env = os.environ.copy()
  171. + env['Y_PYTHON_ENTRY_POINT'] = ':main'
  172. res = subprocess.check_output([sys.executable, "-c", code],
  173. - stderr=subprocess.STDOUT, text=True)
  174. + stderr=subprocess.STDOUT, text=True, env=env)
  175. assert "ValueError" in res
  176. --- contrib/python/numpy/py3/numpy/core/tests/test_protocols.py (index)
  177. +++ contrib/python/numpy/py3/numpy/core/tests/test_protocols.py (working tree)
  178. @@ -4,4 +4,5 @@ import warnings
  179. +@pytest.mark.skip
  180. @pytest.mark.filterwarnings("error")
  181. def test_getattr_warning():
  182. --- contrib/python/numpy/py3/numpy/linalg/tests/test_linalg.py (index)
  183. +++ contrib/python/numpy/py3/numpy/linalg/tests/test_linalg.py (working tree)
  184. @@ -1898,6 +1898,7 @@ def test_xerbla_override():
  185. pytest.skip('Numpy xerbla not linked in.')
  186. +@pytest.mark.skip
  187. @pytest.mark.skipif(IS_WASM, reason="Cannot start subprocess")
  188. @pytest.mark.slow
  189. def test_sdot_bug_8577():
  190. --- contrib/python/numpy/py3/numpy/tests/test_reloading.py (index)
  191. +++ contrib/python/numpy/py3/numpy/tests/test_reloading.py (working tree)
  192. @@ -37,6 +37,7 @@ def test_novalue():
  193. protocol=proto)) is np._NoValue)
  194. +@pytest.mark.skip
  195. @pytest.mark.skipif(IS_WASM, reason="can't start subprocess")
  196. def test_full_reimport():
  197. """At the time of writing this, it is *not* truly supported, but
  198. --- contrib/python/numpy/py3/numpy/core/tests/test_limited_api.py (index)
  199. +++ contrib/python/numpy/py3/numpy/core/tests/test_limited_api.py (working tree)
  200. @@ -6,6 +6,7 @@ import sysconfig
  201. import pytest
  202. +@pytest.mark.skip
  203. @pytest.mark.skipif(IS_WASM, reason="Can't start subprocess")
  204. @pytest.mark.xfail(
  205. sysconfig.get_config_var("Py_DEBUG"),
  206. --- contrib/python/numpy/py3/numpy/linalg/tests/test_linalg.py (index)
  207. +++ contrib/python/numpy/py3/numpy/linalg/tests/test_linalg.py (working tree)
  208. @@ -1754,6 +1754,7 @@ class TestQR:
  209. assert_(isinstance(r2, a_type))
  210. assert_almost_equal(r2, r1)
  211. + @pytest.mark.skip
  212. @pytest.mark.parametrize("size", [
  213. (3, 4), (4, 3), (4, 4),
  214. (3, 0), (0, 3)])
  215. --- contrib/python/numpy/py3/numpy/lib/tests/test_loadtxt.py (index)
  216. +++ contrib/python/numpy/py3/numpy/lib/tests/test_loadtxt.py (working tree)
  217. @@ -388,6 +388,7 @@ def test_bool():
  218. assert_array_equal(res.view(np.uint8), [[1, 0], [1, 1]])
  219. +@pytest.mark.skip
  220. @pytest.mark.skipif(IS_PYPY and sys.implementation.version <= (7, 3, 8),
  221. reason="PyPy bug in error formatting")
  222. @pytest.mark.parametrize("dtype", np.typecodes["AllInteger"])
  223. @@ -406,6 +407,7 @@ def test_integer_signs(dtype):
  224. np.loadtxt([f"{sign}2\n"], dtype=dtype)
  225. +@pytest.mark.skip
  226. @pytest.mark.skipif(IS_PYPY and sys.implementation.version <= (7, 3, 8),
  227. reason="PyPy bug in error formatting")
  228. @pytest.mark.parametrize("dtype", np.typecodes["AllInteger"])
  229. --- contrib/python/numpy/py3/numpy/core/tests/test_nep50_promotions.py (index)
  230. +++ contrib/python/numpy/py3/numpy/core/tests/test_nep50_promotions.py (working tree)
  231. @@ -20,6 +20,7 @@ def _weak_promotion_enabled():
  232. np._set_promotion_state(state)
  233. +@pytest.mark.skip
  234. @pytest.mark.skipif(IS_WASM, reason="wasm doesn't have support for fp errors")
  235. def test_nep50_examples():
  236. with pytest.warns(UserWarning, match="result dtype changed"):
  237. --- contrib/python/numpy/py3/numpy/core/tests/test_cpu_features.py (index)
  238. +++ contrib/python/numpy/py3/numpy/core/tests/test_cpu_features.py (working tree)
  239. @@ -122,6 +122,7 @@ class AbstractTest:
  240. " therefore this test class cannot be properly executed."
  241. ),
  242. )
  243. +@pytest.mark.xfail
  244. class TestEnvPrivation:
  245. cwd = pathlib.Path(__file__).parent.resolve()
  246. env = os.environ.copy()
  247. --- contrib/python/numpy/py3/numpy/core/tests/test_numeric.py (index)
  248. +++ contrib/python/numpy/py3/numpy/core/tests/test_numeric.py (working tree)
  249. @@ -2352,7 +2352,7 @@ class TestClip:
  250. actual = np.clip(arr, amin, amax)
  251. assert_equal(actual, expected)
  252. - @pytest.mark.xfail(reason="propagation doesn't match spec")
  253. + @pytest.mark.skip(reason="propagation doesn't match spec")
  254. @pytest.mark.parametrize("arr, amin, amax", [
  255. (np.array([1] * 10, dtype='m8'),
  256. np.timedelta64('NaT'),