* Package: dev-python/pytest-regressions-2.3.1 * Repository: gentoo * Maintainer: andrewammerlaan@gentoo.org python@gentoo.org * USE: elibc_glibc kernel_linux python_targets_python3_8 python_targets_python3_9 sparc test userland_GNU * FEATURES: network-sandbox preserve-libs sandbox test userpriv usersandbox >>> Unpacking source... >>> Unpacking pytest-regressions-2.3.1.tar.gz to /var/tmp/portage/dev-python/pytest-regressions-2.3.1/work >>> Source unpacked in /var/tmp/portage/dev-python/pytest-regressions-2.3.1/work >>> Preparing source in /var/tmp/portage/dev-python/pytest-regressions-2.3.1/work/pytest-regressions-2.3.1 ... >>> Source prepared. >>> Configuring source in /var/tmp/portage/dev-python/pytest-regressions-2.3.1/work/pytest-regressions-2.3.1 ... >>> Source configured. >>> Compiling source in /var/tmp/portage/dev-python/pytest-regressions-2.3.1/work/pytest-regressions-2.3.1 ... * python3_8: running distutils-r1_run_phase distutils-r1_python_compile python3.8 setup.py build -j 150 running build running build_py creating build creating build/lib creating build/lib/pytest_regressions copying src/pytest_regressions/__init__.py -> build/lib/pytest_regressions copying src/pytest_regressions/data_regression.py -> build/lib/pytest_regressions copying src/pytest_regressions/dataframe_regression.py -> build/lib/pytest_regressions copying src/pytest_regressions/testing.py -> build/lib/pytest_regressions copying src/pytest_regressions/image_regression.py -> build/lib/pytest_regressions copying src/pytest_regressions/num_regression.py -> build/lib/pytest_regressions copying src/pytest_regressions/ndarrays_regression.py -> build/lib/pytest_regressions copying src/pytest_regressions/plugin.py -> build/lib/pytest_regressions copying src/pytest_regressions/common.py -> build/lib/pytest_regressions copying src/pytest_regressions/file_regression.py -> build/lib/pytest_regressions warning: build_py: byte-compiling is disabled, skipping. * Building the wheel via setuptools.build_meta:__legacy__ running bdist_wheel running build running build_py warning: build_py: byte-compiling is disabled, skipping. running install running install_lib creating build/bdist.linux-sparc64 creating build/bdist.linux-sparc64/wheel creating build/bdist.linux-sparc64/wheel/pytest_regressions warning: install_lib: byte-compiling is disabled, skipping. running install_egg_info running egg_info listing git files failed - pretending there aren't any writing manifest file 'src/pytest_regressions.egg-info/SOURCES.txt' Copying src/pytest_regressions.egg-info to build/bdist.linux-sparc64/wheel/pytest_regressions-2.3.1-py3.8.egg-info running install_scripts * Installing the wheel to /var/tmp/portage/dev-python/pytest-regressions-2.3.1/work/pytest-regressions-2.3.1-python3_8/install python3.8 setup.py clean -a running clean removing 'build/lib' (and everything under it) removing 'build/bdist.linux-sparc64' (and everything under it) 'build/scripts-3.8' does not exist -- can't clean it * python3_9: running distutils-r1_run_phase distutils-r1_python_compile python3.9 setup.py build -j 150 running build running build_py creating build creating build/lib creating build/lib/pytest_regressions copying src/pytest_regressions/__init__.py -> build/lib/pytest_regressions copying src/pytest_regressions/data_regression.py -> build/lib/pytest_regressions copying src/pytest_regressions/dataframe_regression.py -> build/lib/pytest_regressions copying src/pytest_regressions/testing.py -> build/lib/pytest_regressions copying src/pytest_regressions/image_regression.py -> build/lib/pytest_regressions copying src/pytest_regressions/num_regression.py -> build/lib/pytest_regressions copying src/pytest_regressions/ndarrays_regression.py -> build/lib/pytest_regressions copying src/pytest_regressions/plugin.py -> build/lib/pytest_regressions copying src/pytest_regressions/common.py -> build/lib/pytest_regressions copying src/pytest_regressions/file_regression.py -> build/lib/pytest_regressions warning: build_py: byte-compiling is disabled, skipping. * Building the wheel via setuptools.build_meta:__legacy__ running bdist_wheel running build running build_py warning: build_py: byte-compiling is disabled, skipping. running install running install_lib creating build/bdist.linux-sparc64 creating build/bdist.linux-sparc64/wheel creating build/bdist.linux-sparc64/wheel/pytest_regressions warning: install_lib: byte-compiling is disabled, skipping. running install_egg_info running egg_info listing git files failed - pretending there aren't any writing manifest file 'src/pytest_regressions.egg-info/SOURCES.txt' Copying src/pytest_regressions.egg-info to build/bdist.linux-sparc64/wheel/pytest_regressions-2.3.1-py3.9.egg-info running install_scripts * Installing the wheel to /var/tmp/portage/dev-python/pytest-regressions-2.3.1/work/pytest-regressions-2.3.1-python3_9/install python3.9 setup.py clean -a running clean removing 'build/lib' (and everything under it) removing 'build/bdist.linux-sparc64' (and everything under it) 'build/scripts-3.9' does not exist -- can't clean it * Using python3.9 in global scope * python3_9: running distutils-r1_run_phase python_compile_all >>> Source compiled. >>> Test phase: dev-python/pytest-regressions-2.3.1 * python3_8: running distutils-r1_run_phase python_test python3.8 -m pytest -vv -ra -l -Wdefault --color=no -p no:cov -p no:flake8 -p no:flakes -p no:pylint ============================= test session starts ============================== platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /var/tmp/portage/dev-python/pytest-regressions-2.3.1/work/pytest-regressions-2.3.1-python3_8/install/usr/bin/python3.8 cachedir: .pytest_cache rootdir: /var/tmp/portage/dev-python/pytest-regressions-2.3.1/work/pytest-regressions-2.3.1, configfile: tox.ini plugins: regressions-2.3.1, pkgcore-0.12.9, tornasync-0.6.0.post2, asyncio-0.17.2, pytest_param_files-0.3.4, anyio-3.5.0, timeout-2.1.0, typeguard-2.13.3, console-scripts-1.2.2, mock-3.7.0, datadir-1.3.1 asyncio: mode=legacy collecting ... collected 68 items tests/test_data_regression.py::test_example PASSED [ 1%] tests/test_data_regression.py::test_basename PASSED [ 2%] tests/test_data_regression.py::test_custom_object PASSED [ 4%] tests/test_data_regression.py::test_usage_workflow PASSED [ 5%] tests/test_data_regression.py::test_data_regression_full_path PASSED [ 7%] tests/test_data_regression.py::test_data_regression_no_aliases PASSED [ 8%] tests/test_data_regression.py::test_not_create_file_on_error PASSED [ 10%] tests/test_dataframe_regression.py::test_usage_workflow PASSED [ 11%] tests/test_dataframe_regression.py::test_common_cases PASSED [ 13%] tests/test_dataframe_regression.py::test_different_data_types PASSED [ 14%] tests/test_dataframe_regression.py::test_non_numeric_data[array0] PASSED [ 16%] tests/test_dataframe_regression.py::test_non_numeric_data[array1] PASSED [ 17%] tests/test_dataframe_regression.py::test_arrays_with_different_sizes PASSED [ 19%] tests/test_dataframe_regression.py::test_integer_values_smoke_test PASSED [ 20%] tests/test_dataframe_regression.py::test_number_formats PASSED [ 22%] tests/test_dataframe_regression.py::test_bool_array PASSED [ 23%] tests/test_dataframe_regression.py::test_arrays_of_same_size PASSED [ 25%] tests/test_dataframe_regression.py::test_string_array PASSED [ 26%] tests/test_dataframe_regression.py::test_non_pandas_dataframe PASSED [ 27%] tests/test_dataframe_regression.py::test_dataframe_with_empty_strings PASSED [ 29%] tests/test_file_regression.py::test_simple_text_file PASSED [ 30%] tests/test_file_regression.py::test_simple_bin_file PASSED [ 32%] tests/test_file_regression.py::test_binary_and_text_error PASSED [ 33%] tests/test_file_regression.py::test_file_regression_workflow PASSED [ 35%] tests/test_filenames.py::test_foo PASSED [ 36%] tests/test_filenames.py::TestClass::test_foo PASSED [ 38%] tests/test_filenames.py::TestClassWithIgnoredName::test_foo PASSED [ 39%] tests/test_grids.py::test_grids PASSED [ 41%] tests/test_grids.py::test_grids2 PASSED [ 42%] tests/test_image_regression.py::test_image_regression PASSED [ 44%] tests/test_image_regression.py::test_image_regression_workflow PASSED [ 45%] tests/test_ndarrays_regression.py::test_usage_workflow PASSED [ 47%] tests/test_ndarrays_regression.py::test_common_case PASSED [ 48%] tests/test_ndarrays_regression.py::test_common_case_nd PASSED [ 50%] tests/test_ndarrays_regression.py::test_common_case_zero_expected PASSED [ 51%] tests/test_ndarrays_regression.py::test_different_data_types FAILED [ 52%] tests/test_ndarrays_regression.py::test_object_dtype PASSED [ 54%] tests/test_ndarrays_regression.py::test_integer_values_smoke_test PASSED [ 55%] tests/test_ndarrays_regression.py::test_float_values_smoke_test PASSED [ 57%] tests/test_ndarrays_regression.py::test_bool_array PASSED [ 58%] tests/test_ndarrays_regression.py::test_complex_array PASSED [ 60%] tests/test_ndarrays_regression.py::test_arrays_of_same_size_1d PASSED [ 61%] tests/test_ndarrays_regression.py::test_arrays_with_different_sizes_1d PASSED [ 63%] tests/test_ndarrays_regression.py::test_arrays_of_same_shape PASSED [ 64%] tests/test_ndarrays_regression.py::test_arrays_with_different_shapes PASSED [ 66%] tests/test_ndarrays_regression.py::test_scalars PASSED [ 67%] tests/test_ndarrays_regression.py::test_string_array PASSED [ 69%] tests/test_ndarrays_regression.py::test_non_dict PASSED [ 70%] tests/test_ndarrays_regression.py::test_structured_array PASSED [ 72%] tests/test_ndarrays_regression.py::test_new_obtained PASSED [ 73%] tests/test_ndarrays_regression.py::test_missing_obtained PASSED [ 75%] tests/test_num_regression.py::test_usage_workflow PASSED [ 76%] tests/test_num_regression.py::test_common_cases PASSED [ 77%] tests/test_num_regression.py::test_different_data_types PASSED [ 79%] tests/test_num_regression.py::test_n_dimensions PASSED [ 80%] tests/test_num_regression.py::test_arrays_with_different_sizes PASSED [ 82%] tests/test_num_regression.py::test_integer_values_smoke_test PASSED [ 83%] tests/test_num_regression.py::test_number_formats PASSED [ 85%] tests/test_num_regression.py::test_fill_different_shape_with_nan PASSED [ 86%] tests/test_num_regression.py::test_fill_different_shape_with_nan_false PASSED [ 88%] tests/test_num_regression.py::test_fill_different_shape_with_nan_for_non_float_array PASSED [ 89%] tests/test_num_regression.py::test_bool_array PASSED [ 91%] tests/test_num_regression.py::test_arrays_of_same_size PASSED [ 92%] tests/test_num_regression.py::test_simple_numbers PASSED [ 94%] tests/test_num_regression.py::test_simple_list_of_numbers PASSED [ 95%] tests/test_num_regression.py::test_simple_tuple_of_numbers PASSED [ 97%] tests/test_num_regression.py::test_simple_list_of_mostly_numbers PASSED [ 98%] tests/test_num_regression.py::test_array_dtype_stored_correctly PASSED [100%] =================================== FAILURES =================================== __________________________ test_different_data_types ___________________________ ndarrays_regression = no_regen = None def test_different_data_types(ndarrays_regression, no_regen): # Generate data with integer array. data = {"data1": np.array([1] * 10)} ndarrays_regression.check(data) # Run check with incompatible type. data = {"data1": np.array([True] * 10)} with pytest.raises( AssertionError, match="Data types are not the same.\nkey: data1\nObtained: bool\nExpected: int64\n", ): > ndarrays_regression.check(data) data = {'data1': array([ True, True, True, True, True, True, True, True, True, True])} ndarrays_regression = no_regen = None tests/test_ndarrays_regression.py:298: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = data_dict = {'data1': array([ True, True, True, True, True, True, True, True, True, True])} basename = None, fullpath = None, tolerances = {}, default_tolerance = {} def check( self, data_dict, basename=None, fullpath=None, tolerances=None, default_tolerance=None, ): """ Checks a dictionary of NumPy ndarrays, containing only numeric data, against a previously recorded version, or generate a new file. Example:: def test_some_data(ndarrays_regression): points, values = some_function() ndarrays_regression.check( { 'points': points, # array with shape (100, 3) 'values': values, # array with shape (100,) }, default_tolerance=dict(atol=1e-8, rtol=1e-8) ) :param Dict[str, numpy.ndarray] data_dict: dictionary of NumPy ndarrays containing data for regression check. The arrays can have any shape. :param str basename: basename of the file to test/record. If not given the name of the test is used. :param str fullpath: complete path to use as a reference file. This option will ignore embed_data completely, being useful if a reference file is located in the session data dir for example. :param dict tolerances: dict mapping keys from the data_dict to tolerance settings for the given data. Example:: tolerances={'U': Tolerance(atol=1e-2)} :param dict default_tolerance: dict mapping the default tolerance for the current check call. Example:: default_tolerance=dict(atol=1e-7, rtol=1e-18). If not provided, will use defaults from numpy's ``isclose`` function. ``basename`` and ``fullpath`` are exclusive. """ try: import numpy as np except ModuleNotFoundError: raise ModuleNotFoundError(import_error_message("NumPy")) import functools __tracebackhide__ = True if not isinstance(data_dict, dict): raise TypeError( "Only dictionaries with NumPy arrays or array-like objects are " "supported on ndarray_regression fixture.\n" "Object with type '{}' was given.".format(str(type(data_dict))) ) for key, array in data_dict.items(): assert isinstance( key, str ), "The dictionary keys must be strings. " "Found key with type '%s'" % ( str(type(key)) ) data_dict[key] = np.asarray(array) for key, array in data_dict.items(): # Accepted: # - b: boolean # - i: signed integer # - u: unsigned integer # - f: floating-point number # - c: complex floating-point number # - U: unicode string # Rejected: # - m: timedelta # - M: datetime # - O: objects # - S: zero-terminated bytes # - V: void (raw data, structured arrays) if array.dtype.kind not in ["b", "i", "u", "f", "c", "U"]: raise TypeError( "Only numeric or unicode data is supported on ndarrays_regression " f"fixture.\nArray '{key}' with type '{array.dtype}' was given." ) if tolerances is None: tolerances = {} self._tolerances_dict = tolerances if default_tolerance is None: default_tolerance = {} self._default_tolerance = default_tolerance dump_fn = functools.partial(self._dump_fn, data_dict) > perform_regression_check( datadir=self.datadir, original_datadir=self.original_datadir, request=self.request, check_fn=self._check_fn, dump_fn=dump_fn, extension=".npz", basename=basename, fullpath=fullpath, force_regen=self._force_regen, with_test_class_names=self._with_test_class_names, ) __tracebackhide__ = True array = array([ True, True, True, True, True, True, True, True, True, True]) basename = None data_dict = {'data1': array([ True, True, True, True, True, True, True, True, True, True])} default_tolerance = {} dump_fn = functools.partial(>, {'data1': array([ True, True, True, True, True, True, True, True, True, True])}) fullpath = None functools = key = 'data1' np = self = tolerances = {} ../pytest-regressions-2.3.1-python3_8/install/usr/lib/python3.8/site-packages/pytest_regressions/ndarrays_regression.py:342: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ datadir = PosixPath('/var/tmp/portage/dev-python/pytest-regressions-2.3.1/temp/pytest-of-portage/pytest-0/test_different_data_types1/test_ndarrays_regression') original_datadir = PosixPath('/var/tmp/portage/dev-python/pytest-regressions-2.3.1/work/pytest-regressions-2.3.1/tests/test_ndarrays_regression') request = > check_fn = > dump_fn = functools.partial(>, {'data1': array([ True, True, True, True, True, True, True, True, True, True])}) extension = '.npz', basename = 'test_different_data_types', fullpath = None force_regen = False, with_test_class_names = False obtained_filename = PosixPath('/var/tmp/portage/dev-python/pytest-regressions-2.3.1/temp/pytest-of-portage/pytest-0/test_different_data_types1/test_ndarrays_regression/test_different_data_types.obtained.npz') dump_aux_fn = at 0xfff800011a580f70> def perform_regression_check( datadir, original_datadir, request, check_fn, dump_fn, extension, basename=None, fullpath=None, force_regen=False, with_test_class_names=False, obtained_filename=None, dump_aux_fn=lambda filename: [], ): """ First run of this check will generate a expected file. Following attempts will always try to match obtained files with that expected file. If expected file needs to be updated, just enable `force_regen` argument. :param Path datadir: Fixture embed_data. :param Path original_datadir: Fixture embed_data. :param SubRequest request: Pytest request object. :param callable check_fn: A function that receives as arguments, respectively, absolute path to obtained file and absolute path to expected file. It must assert if contents of file match. Function can safely assume that obtained file is already dumped and only care about comparison. :param callable dump_fn: A function that receive an absolute file path as argument. Implementor must dump file in this path. :param callable dump_aux_fn: A function that receives the same file path as ``dump_fn``, but may dump additional files to help diagnose this regression later (for example dumping image of 3d views and plots to compare later). Must return the list of file names written (used to display). :param str extension: Extension of files compared by this check. :param bool force_regen: if true it will regenerate expected file. :param bool with_test_class_names: if true it will use the test class name (if any) to compose the basename. :param str obtained_filename: complete path to use to write the obtained file. By default will prepend `.obtained` before the file extension. ..see: `data_regression.Check` for `basename` and `fullpath` arguments. """ import re assert not (basename and fullpath), "pass either basename or fullpath, but not both" __tracebackhide__ = True with_test_class_names = with_test_class_names or request.config.getoption( "with_test_class_names" ) if basename is None: if (request.node.cls is not None) and (with_test_class_names): basename = re.sub(r"[\W]", "_", request.node.cls.__name__) + "_" else: basename = "" basename += re.sub(r"[\W]", "_", request.node.name) if fullpath: filename = source_filename = Path(fullpath) else: filename = datadir / (basename + extension) source_filename = original_datadir / (basename + extension) def make_location_message(banner, filename, aux_files): msg = [banner, f"- {filename}"] if aux_files: msg.append("Auxiliary:") msg += [f"- {x}" for x in aux_files] return "\n".join(msg) force_regen = force_regen or request.config.getoption("force_regen") if not filename.is_file(): source_filename.parent.mkdir(parents=True, exist_ok=True) dump_fn(source_filename) aux_created = dump_aux_fn(source_filename) msg = make_location_message( "File not found in data directory, created:", source_filename, aux_created ) pytest.fail(msg) else: if obtained_filename is None: if fullpath: obtained_filename = (datadir / basename).with_suffix( ".obtained" + extension ) else: obtained_filename = filename.with_suffix(".obtained" + extension) dump_fn(obtained_filename) try: > check_fn(obtained_filename, filename) __tracebackhide__ = True basename = 'test_different_data_types' check_fn = > datadir = PosixPath('/var/tmp/portage/dev-python/pytest-regressions-2.3.1/temp/pytest-of-portage/pytest-0/test_different_data_types1/test_ndarrays_regression') dump_aux_fn = at 0xfff800011a580f70> dump_fn = functools.partial(>, {'data1': array([ True, True, True, True, True, True, True, True, True, True])}) extension = '.npz' filename = PosixPath('/var/tmp/portage/dev-python/pytest-regressions-2.3.1/temp/pytest-of-portage/pytest-0/test_different_data_types1/test_ndarrays_regression/test_different_data_types.npz') force_regen = False fullpath = None make_location_message = .make_location_message at 0xfff800011e026ca0> obtained_filename = PosixPath('/var/tmp/portage/dev-python/pytest-regressions-2.3.1/temp/pytest-of-portage/pytest-0/test_different_data_types1/test_ndarrays_regression/test_different_data_types.obtained.npz') original_datadir = PosixPath('/var/tmp/portage/dev-python/pytest-regressions-2.3.1/work/pytest-regressions-2.3.1/tests/test_ndarrays_regression') re = request = > source_filename = PosixPath('/var/tmp/portage/dev-python/pytest-regressions-2.3.1/work/pytest-regressions-2.3.1/tests/test_ndarrays_regression/test_different_data_types.npz') with_test_class_names = False ../pytest-regressions-2.3.1-python3_8/install/usr/lib/python3.8/site-packages/pytest_regressions/common.py:162: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = obtained_filename = PosixPath('/var/tmp/portage/dev-python/pytest-regressions-2.3.1/temp/pytest-of-portage/pytest-0/test_different_data_types1/test_ndarrays_regression/test_different_data_types.obtained.npz') expected_filename = PosixPath('/var/tmp/portage/dev-python/pytest-regressions-2.3.1/temp/pytest-of-portage/pytest-0/test_different_data_types1/test_ndarrays_regression/test_different_data_types.npz') def _check_fn(self, obtained_filename, expected_filename): """ Check if dict contents dumped to a file match the contents in expected file. :param str obtained_filename: :param str expected_filename: """ try: import numpy as np except ModuleNotFoundError: raise ModuleNotFoundError(import_error_message("NumPy")) __tracebackhide__ = True # Turn result of np.load into a dictionary, such that the files are closed immediately. obtained_data = dict(np.load(str(obtained_filename))) expected_data = dict(np.load(str(expected_filename))) # Check mismatches in the keys. if set(obtained_data) != set(expected_data): error_msg = ( "They keys in the obtained results differ from the expected results.\n" ) error_msg += " Matching keys: " error_msg += str(list(set(obtained_data) & set(expected_data))) error_msg += "\n" error_msg += " New in obtained: " error_msg += str(list(set(obtained_data) - set(expected_data))) error_msg += "\n" error_msg += " Missing from obtained: " error_msg += str(list(set(expected_data) - set(obtained_data))) error_msg += "\n" error_msg += "To update values, use --force-regen option.\n\n" raise AssertionError(error_msg) # Compare the contents of the arrays. comparison_tables_dict = {} for k, obtained_array in obtained_data.items(): expected_array = expected_data.get(k) tolerance_args = self._tolerances_dict.get(k, self._default_tolerance) > self._check_data_types(k, obtained_array, expected_array) __tracebackhide__ = True comparison_tables_dict = {} expected_array = array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) expected_data = {'data1': array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1])} expected_filename = PosixPath('/var/tmp/portage/dev-python/pytest-regressions-2.3.1/temp/pytest-of-portage/pytest-0/test_different_data_types1/test_ndarrays_regression/test_different_data_types.npz') k = 'data1' np = obtained_array = array([ True, True, True, True, True, True, True, True, True, True]) obtained_data = {'data1': array([ True, True, True, True, True, True, True, True, True, True])} obtained_filename = PosixPath('/var/tmp/portage/dev-python/pytest-regressions-2.3.1/temp/pytest-of-portage/pytest-0/test_different_data_types1/test_ndarrays_regression/test_different_data_types.obtained.npz') self = tolerance_args = {} ../pytest-regressions-2.3.1-python3_8/install/usr/lib/python3.8/site-packages/pytest_regressions/ndarrays_regression.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = key = 'data1' obtained_array = array([ True, True, True, True, True, True, True, True, True, True]) expected_array = array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) def _check_data_types(self, key, obtained_array, expected_array): """ Check if data type of obtained and expected arrays are the same. Fail if not. Helper method used in _check_fn method. """ try: import numpy as np except ModuleNotFoundError: raise ModuleNotFoundError(import_error_message("NumPy")) __tracebackhide__ = True if obtained_array.dtype != expected_array.dtype: # Check if both data types are comparable as numbers (float, int, short, bytes, etc...) if np.issubdtype(obtained_array.dtype, np.number) and np.issubdtype( expected_array.dtype, np.number ): return # Check if both data types are comparable as strings if np.issubdtype(obtained_array.dtype, str) and np.issubdtype( expected_array.dtype, str ): return # In case they are not, assume they are not comparable error_msg = ( "Data types are not the same.\n" f"key: {key}\n" f"Obtained: {obtained_array.dtype}\n" f"Expected: {expected_array.dtype}\n" ) > raise AssertionError(error_msg) E AssertionError: Data types are not the same. E key: data1 E Obtained: bool E Expected: obtained_array = array([ True, True, True, True, True, True, True, True, True, True]) self = ../pytest-regressions-2.3.1-python3_8/install/usr/lib/python3.8/site-packages/pytest_regressions/ndarrays_regression.py:59: AssertionError During handling of the above exception, another exception occurred: ndarrays_regression = no_regen = None def test_different_data_types(ndarrays_regression, no_regen): # Generate data with integer array. data = {"data1": np.array([1] * 10)} ndarrays_regression.check(data) # Run check with incompatible type. data = {"data1": np.array([True] * 10)} with pytest.raises( AssertionError, match="Data types are not the same.\nkey: data1\nObtained: bool\nExpected: int64\n", ): > ndarrays_regression.check(data) E AssertionError: Regex pattern 'Data types are not the same.\nkey: data1\nObtained: bool\nExpected: int64\n' does not match 'Data types are not the same.\nkey: data1\nObtained: bool\nExpected: no_regen = None tests/test_ndarrays_regression.py:298: AssertionError =============================== warnings summary =============================== ../../../../../../../usr/lib/python3.8/site-packages/pytest_asyncio/plugin.py:191 /usr/lib/python3.8/site-packages/pytest_asyncio/plugin.py:191: DeprecationWarning: The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytest configuration file. config.issue_config_time_warning(LEGACY_MODE, stacklevel=2) tests/test_data_regression.py::test_usage_workflow /usr/lib/python3.8/site-packages/pytest_asyncio/plugin.py:317: DeprecationWarning: '@pytest.fixture' is applied to in 'legacy' mode, please replace it with '@pytest_asyncio.fixture' as a preparation for switching to 'strict' mode (or use 'auto' mode to seamlessly handle all these fixtures as asyncio-driven). warnings.warn( -- Docs: https://docs.pytest.org/en/stable/warnings.html =========================== short test summary info ============================ FAILED tests/test_ndarrays_regression.py::test_different_data_types - Asserti... ================== 1 failed, 67 passed, 2 warnings in 36.79s =================== * ERROR: dev-python/pytest-regressions-2.3.1::gentoo failed (test phase): * pytest failed with python3.8 * * Call stack: * ebuild.sh, line 127: Called src_test * environment, line 3058: Called distutils-r1_src_test * environment, line 1373: Called _distutils-r1_run_foreach_impl 'python_test' * environment, line 512: Called python_foreach_impl 'distutils-r1_run_phase' 'python_test' * environment, line 2703: Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_test' * environment, line 2231: Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_test' * environment, line 2229: Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_test' * environment, line 813: Called distutils-r1_run_phase 'python_test' * environment, line 1300: Called python_test * environment, line 2999: Called distutils-r1_python_test * environment, line 1252: Called epytest * environment, line 1742: Called die * The specific snippet of code: * "${@}" || die -n "pytest failed with ${EPYTHON}"; * * If you need support, post the output of `emerge --info '=dev-python/pytest-regressions-2.3.1::gentoo'`, * the complete build log and the output of `emerge -pqv '=dev-python/pytest-regressions-2.3.1::gentoo'`. * The complete build log is located at '/var/tmp/portage/dev-python/pytest-regressions-2.3.1/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-python/pytest-regressions-2.3.1/temp/environment'. * Working directory: '/var/tmp/portage/dev-python/pytest-regressions-2.3.1/work/pytest-regressions-2.3.1' * S: '/var/tmp/portage/dev-python/pytest-regressions-2.3.1/work/pytest-regressions-2.3.1' # emerge --info !!! It seems /run is not mounted. Process management may malfunction. Portage 3.0.30 (python 3.9.10-final-0, default/linux/sparc/17.0/64ul, gcc-11.2.1, glibc-2.34-r7, 5.15.5-gentoo sparc64) ================================================================= System uname: Linux-5.15.5-gentoo-sparc64-sun4v-with-glibc2.34 KiB Mem: 531346648 total, 459345352 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Mon, 07 Feb 2022 07:21:58 +0000 sh dash 0.5.11.5 ld GNU ld (Gentoo 2.37_p1 p2) 2.37 ccache version 4.5.1 [disabled] app-misc/pax-utils: 1.3.3::gentoo app-shells/bash: 5.1_p16::gentoo dev-lang/perl: 5.34.0-r6::gentoo dev-lang/python: 3.8.12_p1-r2::gentoo, 3.9.10-r1::gentoo dev-util/ccache: 4.5.1::gentoo dev-util/cmake: 3.22.2::gentoo dev-util/meson: 0.60.3::gentoo sys-apps/baselayout: 2.8::gentoo sys-apps/openrc: 0.44.10::gentoo sys-apps/sandbox: 2.29::gentoo sys-devel/autoconf: 2.71-r1::gentoo sys-devel/automake: 1.16.5::gentoo sys-devel/binutils: 2.37_p1-r2::gentoo sys-devel/binutils-config: 5.4::gentoo sys-devel/clang: 13.0.0::gentoo sys-devel/gcc: 11.2.1_p20220115::gentoo sys-devel/gcc-config: 2.5-r1::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/llvm: 13.0.0::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.16::gentoo (virtual/os-headers) sys-libs/glibc: 2.34-r7::gentoo Repositories: gentoo location: /bound/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-max-age: 24 sync-rsync-verify-jobs: 1 sync-rsync-extra-opts: sync-rsync-verify-metamanifest: yes ACCEPT_KEYWORDS="sparc ~sparc" ACCEPT_LICENSE="@FREE" CBUILD="sparc64-unknown-linux-gnu" CFLAGS="-O2 -mcpu=ultrasparc -pipe" CHOST="sparc64-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -mcpu=ultrasparc -pipe" DISTDIR="/bound/distfiles" EMERGE_DEFAULT_OPTS="--complete-graph --with-bdeps=y --keep-going --deep" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" FCFLAGS="-O2 -mcpu=ultrasparc -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -mcpu=ultrasparc -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="C.UTF8" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu" MAKEOPTS="-j150 -l257" PKGDIR="/var/cache/binpkgs" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" SHELL="/bin/bash" USE="acl big-endian bzip2 caps cli crypt dbus dri filecaps fortran gdbm gmp iconv introspection ipv6 jit libglvnd libtirpc llvm-libunwind ncurses nls nptl openmp pam pcre readline sparc split-usr ssl unicode xattr zlib" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9 python3_8" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="dummy fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS