diff --git a/.flake8 b/.flake8 index 7eedd967b962..f92b3cb780f6 100644 --- a/.flake8 +++ b/.flake8 @@ -56,7 +56,7 @@ exclude = build, dpnp/to_numba/*.py, conda.recipe, - tests/*.py, + dpnp/tests/*.py, tests_external/*.py, versioneer.py, diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 4dda52406ab1..6561992b4016 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -10,7 +10,6 @@ permissions: read-all env: PACKAGE_NAME: dpnp - MODULE_NAME: dpnp # Follow oneAPI installation instruction for conda, since intel channel is not longer available # CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels' CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels' @@ -116,7 +115,6 @@ jobs: channel-path: '${{ github.workspace }}/channel/' pkg-path-in-channel: '${{ github.workspace }}/channel/linux-64/' extracted-pkg-path: '${{ github.workspace }}/pkg/' - tests-path: '${{ github.workspace }}/pkg/info/test/tests/' ver-json-path: '${{ github.workspace }}/version.json' steps: @@ -177,8 +175,7 @@ jobs: - name: Run tests if: env.RERUN_TESTS_ON_FAILURE != 'true' run: | - python -m pytest -q -ra --disable-warnings -vv . - working-directory: ${{ env.tests-path }} + python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests - name: Run tests if: env.RERUN_TESTS_ON_FAILURE == 'true' @@ -192,8 +189,7 @@ jobs: command: | . $CONDA/etc/profile.d/conda.sh conda activate ${{ env.TEST_ENV_NAME }} - cd ${{ env.tests-path }} - python -m pytest -q -ra --disable-warnings -vv . + pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests test_windows: name: Test ['windows-2019', python='${{ matrix.python }}'] @@ -216,8 +212,8 @@ jobs: channel-path: '${{ github.workspace }}\channel\' pkg-path-in-channel: '${{ github.workspace }}\channel\win-64\' extracted-pkg-path: '${{ github.workspace }}\pkg' - tests-path: '${{ github.workspace }}\pkg\info\test\tests\' ver-json-path: '${{ github.workspace }}\version.json' + workdir: '${{ github.workspace }}' steps: - name: Download artifact @@ -314,8 +310,7 @@ jobs: - name: Run tests if: env.RERUN_TESTS_ON_FAILURE != 'true' run: | - python -m pytest -q -ra --disable-warnings -vv . - working-directory: ${{ env.tests-path }} + pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests - name: Run tests if: env.RERUN_TESTS_ON_FAILURE == 'true' @@ -328,8 +323,7 @@ jobs: retry_on: any command: >- mamba activate ${{ env.TEST_ENV_NAME }} - & cd ${{ env.tests-path }} - & python -m pytest -q -ra --disable-warnings -vv . + & pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests upload: name: Upload ['${{ matrix.os }}', python='${{ matrix.python }}'] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e55c9eb8c03..ded4ad9b37ac 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,9 +32,9 @@ repos: - id: python-no-eval exclude: | (?x)^( - tests/test_arraycreation.py| - tests/test_sycl_queue.py| - tests/test_usm_type.py + dpnp/tests/test_arraycreation.py| + dpnp/tests/test_sycl_queue.py| + dpnp/tests/test_usm_type.py )$ - id: python-no-log-warn - id: python-use-type-annotations diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index c4f51f7c8b52..000000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -global-exclude *.cpp -include dpnp/backend/include/*.hpp diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 17dff45056a1..8db89b71a6b2 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -51,14 +51,6 @@ test: requires: - pytest - setuptools - source_files: - - examples - - tests - - setup.cfg - commands: - - python -c "import dpnp; print(dpnp.__version__)" - - python -m dpctl -f - - pytest -s about: home: https://github.com/IntelPython/dpnp diff --git a/conda-recipe/run_test.bat b/conda-recipe/run_test.bat new file mode 100644 index 000000000000..10b2545448f2 --- /dev/null +++ b/conda-recipe/run_test.bat @@ -0,0 +1,41 @@ +@echo on + +REM if ONEAPI_ROOT is specified (use all from it) +if defined ONEAPI_ROOT ( + set "DPCPPROOT=%ONEAPI_ROOT%\compiler\latest" + set "MKLROOT=%ONEAPI_ROOT%\mkl\latest" + set "TBBROOT=%ONEAPI_ROOT%\tbb\latest" + set "DPLROOT=%ONEAPI_ROOT%\dpl\latest" +) + +REM if DPCPPROOT is specified (work with custom DPCPP) +if defined DPCPPROOT ( + call "%DPCPPROOT%\env\vars.bat" +) + +REM if MKLROOT is specified (work with custom math library) +if defined MKLROOT ( + call "%MKLROOT%\env\vars.bat" +) + +REM have to activate while SYCL CPU device/driver needs paths +REM if TBBROOT is specified +if defined TBBROOT ( + call "%TBBROOT%\env\vars.bat" +) + +REM If PYTHON is not set +REM assign it to the Python interpreter from the testing environment +if not defined PYTHON ( + for %%I in (python.exe) do set PYTHON=%%~$PATH:I +) + + +"%PYTHON%" -c "import dpnp; print(dpnp.__version__)" +if errorlevel 1 exit 1 + +"%PYTHON%" -m dpctl -f +if errorlevel 1 exit 1 + +"%PYTHON%" -m pytest -ra --pyargs dpnp +if errorlevel 1 exit 1 diff --git a/conda-recipe/run_test.sh b/conda-recipe/run_test.sh index c67e538e90f9..b2c96df36242 100755 --- a/conda-recipe/run_test.sh +++ b/conda-recipe/run_test.sh @@ -26,3 +26,15 @@ if [ -n "${TBBROOT}" ]; then # shellcheck source=/dev/null . "${TBBROOT}"/env/vars.sh fi + +# If PYTHON is not set +# assign it to the Python interpreter from the testing environment +if [ -z "${PYTHON}" ]; then + PYTHON=$PREFIX/bin/python +fi + +set -e + +$PYTHON -c "import dpnp; print(dpnp.__version__)" +$PYTHON -m dpctl -f +$PYTHON -m pytest -ra --pyargs dpnp diff --git a/tests/__init__.py b/dpnp/tests/__init__.py similarity index 87% rename from tests/__init__.py rename to dpnp/tests/__init__.py index 161e4a1a994a..d7c95f9d701d 100644 --- a/tests/__init__.py +++ b/dpnp/tests/__init__.py @@ -1,6 +1,6 @@ import numpy -from tests import testing +from . import testing numpy.testing.assert_allclose = testing.assert_allclose numpy.testing.assert_array_equal = testing.assert_array_equal diff --git a/tests/conftest.py b/dpnp/tests/conftest.py similarity index 67% rename from tests/conftest.py rename to dpnp/tests/conftest.py index db07c8d463ed..be5b6b0d6ed3 100644 --- a/tests/conftest.py +++ b/dpnp/tests/conftest.py @@ -47,7 +47,66 @@ def get_excluded_tests(test_exclude_file): if os.path.exists(test_exclude_file): with open(test_exclude_file) as skip_names_file: excluded_tests = skip_names_file.readlines() - return excluded_tests + # Remove whitespace and filter out empty lines + return [line.strip() for line in excluded_tests if line.strip()] + + +# Normalize the nodeid to a relative path starting +# from the "tests/" directory +def normalize_test_name(nodeid): + nodeid = nodeid.replace("\n", "").strip() + + # case if run pytest from dpnp folder + if nodeid.startswith("tests/"): + return nodeid + + # case if run pytest --pyargs + if "/tests/" in nodeid: + nodeid = nodeid.split("tests/", 1)[-1] + # Add the "tests/" prefix to ensure the nodeid matches + # the paths in the skipped tests files. + normalized_nodeid = "tests/" + nodeid + # case if run pytest from tests folder + else: + normalized_nodeid = "tests/" + nodeid + + return normalized_nodeid + + +def pytest_configure(config): + # By default, tests marked as slow will be deselected. + # To run all tests, use -m "slow or not slow". + # To run only slow tests, use -m "slow". + # Equivalent to addopts = -m "not slow" + if not config.getoption("markexpr"): + config.option.markexpr = "not slow" + # Equivalent to addopts = --tb=short + if not config.getoption("tbstyle"): + config.option.tbstyle = "short" + # Equivalent to addopts = --strict-markers + if not config.getoption("strict_markers"): + config.option.strict_markers = True + + # Equivalent to norecursedirs = tests_perf + config.addinivalue_line("norecursedirs", "tests_perf") + + # Register pytest markers + config.addinivalue_line( + "markers", "slow: marks tests as slow (deselect with '-m \"not slow\"')" + ) + config.addinivalue_line( + "markers", + "multi_gpu: marks tests that require a specified number of GPUs", + ) + + # NumPy arccosh + # Undefined behavior depends on the backend: + # NumPy with OpenBLAS for np.array[1.0] does not raise a warning + # while numpy with OneMKL raises RuntimeWarning + config.addinivalue_line( + "filterwarnings", + "ignore:invalid value encountered in arccosh:RuntimeWarning", + ) def pytest_collection_modifyitems(config, items): @@ -85,16 +144,21 @@ def pytest_collection_modifyitems(config, items): excluded_tests.extend(get_excluded_tests(test_exclude_file)) for item in items: - # some test name contains '\n' in the parameters - test_name = item.nodeid.replace("\n", "").strip() + test_name = normalize_test_name(item.nodeid) for item_tbl in excluded_tests: - # remove end-of-line character - item_tbl_str = item_tbl.strip() # exact match of the test name with items from excluded_list - if test_name == item_tbl_str: + if test_name == item_tbl: item.add_marker(skip_mark) + # Handle the exclusion of tests marked as "slow" + selected_marker = config.getoption("markexpr") + if "not slow" in selected_marker: + skip_slow = pytest.mark.skip(reason="Skipping slow tests") + for item in items: + if "slow" in item.keywords: + item.add_marker(skip_slow) + @pytest.fixture def allow_fall_back_on_numpy(monkeypatch): diff --git a/tests/helper.py b/dpnp/tests/helper.py similarity index 100% rename from tests/helper.py rename to dpnp/tests/helper.py diff --git a/tests/skipped_tests.tbl b/dpnp/tests/skipped_tests.tbl similarity index 100% rename from tests/skipped_tests.tbl rename to dpnp/tests/skipped_tests.tbl diff --git a/tests/skipped_tests_gpu.tbl b/dpnp/tests/skipped_tests_gpu.tbl similarity index 100% rename from tests/skipped_tests_gpu.tbl rename to dpnp/tests/skipped_tests_gpu.tbl diff --git a/tests/skipped_tests_gpu_no_fp64.tbl b/dpnp/tests/skipped_tests_gpu_no_fp64.tbl similarity index 100% rename from tests/skipped_tests_gpu_no_fp64.tbl rename to dpnp/tests/skipped_tests_gpu_no_fp64.tbl diff --git a/tests/test_absolute.py b/dpnp/tests/test_absolute.py similarity index 100% rename from tests/test_absolute.py rename to dpnp/tests/test_absolute.py diff --git a/tests/test_amin_amax.py b/dpnp/tests/test_amin_amax.py similarity index 100% rename from tests/test_amin_amax.py rename to dpnp/tests/test_amin_amax.py diff --git a/tests/test_arithmetic.py b/dpnp/tests/test_arithmetic.py similarity index 92% rename from tests/test_arithmetic.py rename to dpnp/tests/test_arithmetic.py index 3e4e3162991a..0da904b80bfe 100644 --- a/tests/test_arithmetic.py +++ b/dpnp/tests/test_arithmetic.py @@ -1,9 +1,6 @@ import unittest -import numpy - -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from .third_party.cupy import testing class TestArithmetic(unittest.TestCase): diff --git a/tests/test_array_utils.py b/dpnp/tests/test_array_utils.py similarity index 100% rename from tests/test_array_utils.py rename to dpnp/tests/test_array_utils.py diff --git a/tests/test_arraycreation.py b/dpnp/tests/test_arraycreation.py similarity index 99% rename from tests/test_arraycreation.py rename to dpnp/tests/test_arraycreation.py index 82128c0562eb..909d4d464b06 100644 --- a/tests/test_arraycreation.py +++ b/dpnp/tests/test_arraycreation.py @@ -13,13 +13,12 @@ ) import dpnp -from tests.third_party.cupy import testing from .helper import ( assert_dtype_allclose, get_all_dtypes, - has_support_aspect64, ) +from .third_party.cupy import testing class TestArray: diff --git a/tests/test_arraymanipulation.py b/dpnp/tests/test_arraymanipulation.py similarity index 99% rename from tests/test_arraymanipulation.py rename to dpnp/tests/test_arraymanipulation.py index 0760988af961..3e43ca2e627c 100644 --- a/tests/test_arraymanipulation.py +++ b/dpnp/tests/test_arraymanipulation.py @@ -10,9 +10,9 @@ ) import dpnp -from tests.third_party.cupy import testing from .helper import get_all_dtypes, get_float_complex_dtypes +from .third_party.cupy import testing class TestAtleast1d: diff --git a/tests/test_arraypad.py b/dpnp/tests/test_arraypad.py similarity index 99% rename from tests/test_arraypad.py rename to dpnp/tests/test_arraypad.py index 6f2ad4abc650..34a71eec7070 100644 --- a/tests/test_arraypad.py +++ b/dpnp/tests/test_arraypad.py @@ -10,9 +10,9 @@ import dpnp from dpnp.dpnp_utils.dpnp_utils_pad import _as_pairs as dpnp_as_pairs -from tests.third_party.cupy import testing from .helper import assert_dtype_allclose, get_all_dtypes +from .third_party.cupy import testing class TestPad: diff --git a/tests/test_bitwise.py b/dpnp/tests/test_bitwise.py similarity index 100% rename from tests/test_bitwise.py rename to dpnp/tests/test_bitwise.py diff --git a/tests/test_copy.py b/dpnp/tests/test_copy.py similarity index 100% rename from tests/test_copy.py rename to dpnp/tests/test_copy.py diff --git a/tests/test_counting.py b/dpnp/tests/test_counting.py similarity index 100% rename from tests/test_counting.py rename to dpnp/tests/test_counting.py diff --git a/tests/test_dlpack.py b/dpnp/tests/test_dlpack.py similarity index 100% rename from tests/test_dlpack.py rename to dpnp/tests/test_dlpack.py diff --git a/tests/test_fft.py b/dpnp/tests/test_fft.py similarity index 99% rename from tests/test_fft.py rename to dpnp/tests/test_fft.py index ddc9623611a8..d86eb2071b64 100644 --- a/tests/test_fft.py +++ b/dpnp/tests/test_fft.py @@ -12,7 +12,6 @@ assert_dtype_allclose, get_all_dtypes, get_complex_dtypes, - get_float_complex_dtypes, get_float_dtypes, ) diff --git a/tests/test_fill.py b/dpnp/tests/test_fill.py similarity index 100% rename from tests/test_fill.py rename to dpnp/tests/test_fill.py diff --git a/tests/test_flat.py b/dpnp/tests/test_flat.py similarity index 100% rename from tests/test_flat.py rename to dpnp/tests/test_flat.py diff --git a/tests/test_flipping.py b/dpnp/tests/test_flipping.py similarity index 100% rename from tests/test_flipping.py rename to dpnp/tests/test_flipping.py diff --git a/tests/test_functional.py b/dpnp/tests/test_functional.py similarity index 95% rename from tests/test_functional.py rename to dpnp/tests/test_functional.py index 6f46061aa4ee..fa1da5d74e0b 100644 --- a/tests/test_functional.py +++ b/dpnp/tests/test_functional.py @@ -1,6 +1,6 @@ import numpy import pytest -from numpy.testing import assert_array_equal, assert_equal, assert_raises +from numpy.testing import assert_array_equal import dpnp diff --git a/tests/test_histogram.py b/dpnp/tests/test_histogram.py similarity index 100% rename from tests/test_histogram.py rename to dpnp/tests/test_histogram.py diff --git a/tests/test_indexing.py b/dpnp/tests/test_indexing.py similarity index 99% rename from tests/test_indexing.py rename to dpnp/tests/test_indexing.py index 0d6e5b4e390d..13266470e8c7 100644 --- a/tests/test_indexing.py +++ b/dpnp/tests/test_indexing.py @@ -14,9 +14,9 @@ import dpnp from dpnp.dpnp_array import dpnp_array -from tests.third_party.cupy import testing from .helper import get_all_dtypes, get_integer_dtypes, has_support_aspect64 +from .third_party.cupy import testing def _add_keepdims(func): diff --git a/tests/test_linalg.py b/dpnp/tests/test_linalg.py similarity index 99% rename from tests/test_linalg.py rename to dpnp/tests/test_linalg.py index 36825d23adc1..76ce7989c8c1 100644 --- a/tests/test_linalg.py +++ b/dpnp/tests/test_linalg.py @@ -14,7 +14,6 @@ ) import dpnp as inp -from tests.third_party.cupy import testing from .helper import ( assert_dtype_allclose, @@ -25,6 +24,7 @@ has_support_aspect64, is_cpu_device, ) +from .third_party.cupy import testing def vvsort(val, vec, size, xp): diff --git a/tests/test_logic.py b/dpnp/tests/test_logic.py similarity index 100% rename from tests/test_logic.py rename to dpnp/tests/test_logic.py diff --git a/tests/test_manipulation.py b/dpnp/tests/test_manipulation.py similarity index 99% rename from tests/test_manipulation.py rename to dpnp/tests/test_manipulation.py index 7d53d7efcbeb..d3ac41c55262 100644 --- a/tests/test_manipulation.py +++ b/dpnp/tests/test_manipulation.py @@ -7,7 +7,6 @@ from numpy.testing import assert_array_equal, assert_equal, assert_raises import dpnp -from tests.third_party.cupy import testing from .helper import ( assert_dtype_allclose, @@ -18,6 +17,7 @@ get_integer_dtypes, has_support_aspect64, ) +from .third_party.cupy import testing testdata = [] testdata += [ diff --git a/tests/test_mathematical.py b/dpnp/tests/test_mathematical.py similarity index 99% rename from tests/test_mathematical.py rename to dpnp/tests/test_mathematical.py index 20db6a554f7c..906489760162 100644 --- a/tests/test_mathematical.py +++ b/dpnp/tests/test_mathematical.py @@ -19,7 +19,6 @@ import dpnp from dpnp.dpnp_array import dpnp_array -from tests.third_party.cupy import testing from .helper import ( assert_dtype_allclose, @@ -36,6 +35,7 @@ _get_numpy_arrays_2in_1out, _get_output_data_type, ) +from .third_party.cupy import testing class TestAngle: diff --git a/tests/test_mixins.py b/dpnp/tests/test_mixins.py similarity index 96% rename from tests/test_mixins.py rename to dpnp/tests/test_mixins.py index 01b836b955a0..d86d0939acbd 100644 --- a/tests/test_mixins.py +++ b/dpnp/tests/test_mixins.py @@ -1,6 +1,6 @@ import unittest -from tests.third_party.cupy import testing +from .third_party.cupy import testing class TestMatMul(unittest.TestCase): diff --git a/tests/test_nanfunctions.py b/dpnp/tests/test_nanfunctions.py similarity index 99% rename from tests/test_nanfunctions.py rename to dpnp/tests/test_nanfunctions.py index c2a940e88380..80a169fee860 100644 --- a/tests/test_nanfunctions.py +++ b/dpnp/tests/test_nanfunctions.py @@ -10,7 +10,6 @@ ) import dpnp -from tests.third_party.cupy import testing from .helper import ( assert_dtype_allclose, @@ -20,6 +19,7 @@ get_float_dtypes, has_support_aspect64, ) +from .third_party.cupy import testing class TestNanArgmaxNanArgmin: diff --git a/tests/test_ndarray.py b/dpnp/tests/test_ndarray.py similarity index 99% rename from tests/test_ndarray.py rename to dpnp/tests/test_ndarray.py index eaa3f8c5d211..153b3d0c2e9e 100644 --- a/tests/test_ndarray.py +++ b/dpnp/tests/test_ndarray.py @@ -4,7 +4,6 @@ from numpy.testing import assert_allclose, assert_array_equal import dpnp -from tests.third_party.cupy import testing from .helper import ( get_all_dtypes, @@ -12,6 +11,7 @@ get_float_dtypes, has_support_aspect64, ) +from .third_party.cupy import testing @pytest.mark.usefixtures("suppress_complex_warning") diff --git a/tests/test_outer.py b/dpnp/tests/test_outer.py similarity index 98% rename from tests/test_outer.py rename to dpnp/tests/test_outer.py index 39e8146fdadc..77f57ebf7ddc 100644 --- a/tests/test_outer.py +++ b/dpnp/tests/test_outer.py @@ -5,7 +5,8 @@ from numpy.testing import assert_raises import dpnp as dp -from tests.third_party.cupy import testing + +from .third_party.cupy import testing class TestOuter(unittest.TestCase): diff --git a/tests/test_product.py b/dpnp/tests/test_product.py similarity index 99% rename from tests/test_product.py rename to dpnp/tests/test_product.py index f989ba837343..27437a0a29b3 100644 --- a/tests/test_product.py +++ b/dpnp/tests/test_product.py @@ -5,9 +5,9 @@ from numpy.testing import assert_raises import dpnp -from tests.third_party.cupy import testing from .helper import assert_dtype_allclose, get_all_dtypes, get_complex_dtypes +from .third_party.cupy import testing def _assert_selective_dtype_allclose(result, expected, dtype): diff --git a/tests/test_random.py b/dpnp/tests/test_random.py similarity index 100% rename from tests/test_random.py rename to dpnp/tests/test_random.py diff --git a/tests/test_random_state.py b/dpnp/tests/test_random_state.py similarity index 100% rename from tests/test_random_state.py rename to dpnp/tests/test_random_state.py diff --git a/tests/test_search.py b/dpnp/tests/test_search.py similarity index 100% rename from tests/test_search.py rename to dpnp/tests/test_search.py diff --git a/tests/test_sort.py b/dpnp/tests/test_sort.py similarity index 99% rename from tests/test_sort.py rename to dpnp/tests/test_sort.py index 07156b5d882a..4735e1747deb 100644 --- a/tests/test_sort.py +++ b/dpnp/tests/test_sort.py @@ -4,7 +4,6 @@ from numpy.testing import assert_array_equal, assert_equal, assert_raises import dpnp -from tests.third_party.cupy import testing from .helper import ( assert_dtype_allclose, @@ -12,6 +11,7 @@ get_complex_dtypes, get_float_dtypes, ) +from .third_party.cupy import testing class TestArgsort: diff --git a/tests/test_special.py b/dpnp/tests/test_special.py similarity index 100% rename from tests/test_special.py rename to dpnp/tests/test_special.py diff --git a/tests/test_statistics.py b/dpnp/tests/test_statistics.py similarity index 100% rename from tests/test_statistics.py rename to dpnp/tests/test_statistics.py diff --git a/tests/test_strides.py b/dpnp/tests/test_strides.py similarity index 100% rename from tests/test_strides.py rename to dpnp/tests/test_strides.py diff --git a/tests/test_sum.py b/dpnp/tests/test_sum.py similarity index 99% rename from tests/test_sum.py rename to dpnp/tests/test_sum.py index 2197b3dc686d..21ecab42a6af 100644 --- a/tests/test_sum.py +++ b/dpnp/tests/test_sum.py @@ -7,7 +7,8 @@ ) import dpnp -from tests.helper import ( + +from .helper import ( assert_dtype_allclose, get_all_dtypes, get_float_dtypes, diff --git a/tests/test_sycl_queue.py b/dpnp/tests/test_sycl_queue.py similarity index 100% rename from tests/test_sycl_queue.py rename to dpnp/tests/test_sycl_queue.py diff --git a/tests/test_umath.py b/dpnp/tests/test_umath.py similarity index 100% rename from tests/test_umath.py rename to dpnp/tests/test_umath.py diff --git a/tests/test_usm_type.py b/dpnp/tests/test_usm_type.py similarity index 100% rename from tests/test_usm_type.py rename to dpnp/tests/test_usm_type.py diff --git a/tests/testing/__init__.py b/dpnp/tests/testing/__init__.py similarity index 65% rename from tests/testing/__init__.py rename to dpnp/tests/testing/__init__.py index 62cdd2ddd3a6..138c46b56473 100644 --- a/tests/testing/__init__.py +++ b/dpnp/tests/testing/__init__.py @@ -1,4 +1,4 @@ -from tests.testing.array import ( +from .array import ( assert_allclose, assert_array_equal, assert_equal, diff --git a/tests/testing/array.py b/dpnp/tests/testing/array.py similarity index 100% rename from tests/testing/array.py rename to dpnp/tests/testing/array.py diff --git a/tests/tests_perf/__init__.py b/dpnp/tests/tests_perf/__init__.py similarity index 100% rename from tests/tests_perf/__init__.py rename to dpnp/tests/tests_perf/__init__.py diff --git a/tests/tests_perf/data_generator.py b/dpnp/tests/tests_perf/data_generator.py similarity index 100% rename from tests/tests_perf/data_generator.py rename to dpnp/tests/tests_perf/data_generator.py diff --git a/tests/tests_perf/examples/sinAB_test.py b/dpnp/tests/tests_perf/examples/sinAB_test.py similarity index 100% rename from tests/tests_perf/examples/sinAB_test.py rename to dpnp/tests/tests_perf/examples/sinAB_test.py diff --git a/tests/tests_perf/math_tests/__init__.py b/dpnp/tests/tests_perf/math_tests/__init__.py similarity index 100% rename from tests/tests_perf/math_tests/__init__.py rename to dpnp/tests/tests_perf/math_tests/__init__.py diff --git a/tests/tests_perf/math_tests/test_black_scholes.py b/dpnp/tests/tests_perf/math_tests/test_black_scholes.py similarity index 93% rename from tests/tests_perf/math_tests/test_black_scholes.py rename to dpnp/tests/tests_perf/math_tests/test_black_scholes.py index 88d4da7edfc5..df16496ca1fe 100644 --- a/tests/tests_perf/math_tests/test_black_scholes.py +++ b/dpnp/tests/tests_perf/math_tests/test_black_scholes.py @@ -3,8 +3,8 @@ import numpy import pytest -from tests.tests_perf.data_generator import * -from tests.tests_perf.test_perf_base import DPNPTestPerfBase +from ..data_generator import * +from ..test_perf_base import DPNPTestPerfBase SEED = 7777777 SL, SH = 10.0, 50.0 diff --git a/tests/tests_perf/math_tests/test_dpnp.py b/dpnp/tests/tests_perf/math_tests/test_dpnp.py similarity index 84% rename from tests/tests_perf/math_tests/test_dpnp.py rename to dpnp/tests/tests_perf/math_tests/test_dpnp.py index 558f21acc417..7211feb28a1e 100644 --- a/tests/tests_perf/math_tests/test_dpnp.py +++ b/dpnp/tests/tests_perf/math_tests/test_dpnp.py @@ -2,8 +2,9 @@ import pytest import dpnp -from tests.tests_perf.data_generator import * -from tests.tests_perf.test_perf_base import DPNPTestPerfBase + +from ..data_generator import * +from ..test_perf_base import DPNPTestPerfBase class TestDPNP(DPNPTestPerfBase): diff --git a/tests/tests_perf/math_tests/test_mathematical.py b/dpnp/tests/tests_perf/math_tests/test_mathematical.py similarity index 86% rename from tests/tests_perf/math_tests/test_mathematical.py rename to dpnp/tests/tests_perf/math_tests/test_mathematical.py index 5af69d8d8bc2..a6b7b56e2928 100644 --- a/tests/tests_perf/math_tests/test_mathematical.py +++ b/dpnp/tests/tests_perf/math_tests/test_mathematical.py @@ -1,8 +1,8 @@ import numpy import pytest -from tests.tests_perf.data_generator import * -from tests.tests_perf.test_perf_base import DPNPTestPerfBase +from ..data_generator import * +from ..test_perf_base import DPNPTestPerfBase class TestDPNPMathematical(DPNPTestPerfBase): diff --git a/tests/tests_perf/math_tests/test_trigonometric.py b/dpnp/tests/tests_perf/math_tests/test_trigonometric.py similarity index 95% rename from tests/tests_perf/math_tests/test_trigonometric.py rename to dpnp/tests/tests_perf/math_tests/test_trigonometric.py index f96e10a4c009..dc26e7ce97ad 100644 --- a/tests/tests_perf/math_tests/test_trigonometric.py +++ b/dpnp/tests/tests_perf/math_tests/test_trigonometric.py @@ -2,8 +2,9 @@ import pytest import dpnp -from tests.tests_perf.data_generator import * -from tests.tests_perf.test_perf_base import DPNPTestPerfBase + +from ..data_generator import * +from ..test_perf_base import DPNPTestPerfBase def cos_2_args(input_A, input_B, lib): diff --git a/tests/tests_perf/test_perf_base.py b/dpnp/tests/tests_perf/test_perf_base.py similarity index 100% rename from tests/tests_perf/test_perf_base.py rename to dpnp/tests/tests_perf/test_perf_base.py diff --git a/tests/third_party/__init__.py b/dpnp/tests/third_party/__init__.py similarity index 100% rename from tests/third_party/__init__.py rename to dpnp/tests/third_party/__init__.py diff --git a/tests/third_party/cupy/creation_tests/__init__.py b/dpnp/tests/third_party/cupy/__init__.py similarity index 100% rename from tests/third_party/cupy/creation_tests/__init__.py rename to dpnp/tests/third_party/cupy/__init__.py diff --git a/tests/third_party/cupy/fft_tests/__init__.py b/dpnp/tests/third_party/cupy/binary_tests/__init__.py similarity index 100% rename from tests/third_party/cupy/fft_tests/__init__.py rename to dpnp/tests/third_party/cupy/binary_tests/__init__.py diff --git a/tests/third_party/cupy/binary_tests/test_elementwise.py b/dpnp/tests/third_party/cupy/binary_tests/test_elementwise.py similarity index 95% rename from tests/third_party/cupy/binary_tests/test_elementwise.py rename to dpnp/tests/third_party/cupy/binary_tests/test_elementwise.py index e756c454f150..0dc9a8fbfccc 100644 --- a/tests/third_party/cupy/binary_tests/test_elementwise.py +++ b/dpnp/tests/third_party/cupy/binary_tests/test_elementwise.py @@ -1,6 +1,6 @@ import unittest -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestElementwise(unittest.TestCase): diff --git a/tests/third_party/cupy/indexing_tests/__init__.py b/dpnp/tests/third_party/cupy/core_tests/__init__.py similarity index 100% rename from tests/third_party/cupy/indexing_tests/__init__.py rename to dpnp/tests/third_party/cupy/core_tests/__init__.py diff --git a/tests/third_party/cupy/core_tests/test_core.py b/dpnp/tests/third_party/cupy/core_tests/test_core.py similarity index 98% rename from tests/third_party/cupy/core_tests/test_core.py rename to dpnp/tests/third_party/cupy/core_tests/test_core.py index 42512322bac9..36b8fc340334 100644 --- a/tests/third_party/cupy/core_tests/test_core.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_core.py @@ -5,7 +5,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestSize(unittest.TestCase): diff --git a/tests/third_party/cupy/core_tests/test_core_elementwise.py b/dpnp/tests/third_party/cupy/core_tests/test_core_elementwise.py similarity index 99% rename from tests/third_party/cupy/core_tests/test_core_elementwise.py rename to dpnp/tests/third_party/cupy/core_tests/test_core_elementwise.py index 354a56fc5c42..8adb2bead2c2 100644 --- a/tests/third_party/cupy/core_tests/test_core_elementwise.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_core_elementwise.py @@ -4,7 +4,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestElementwise(unittest.TestCase): diff --git a/tests/third_party/cupy/core_tests/test_dlpack.py b/dpnp/tests/third_party/cupy/core_tests/test_dlpack.py similarity index 98% rename from tests/third_party/cupy/core_tests/test_dlpack.py rename to dpnp/tests/third_party/cupy/core_tests/test_dlpack.py index 18eba5574093..bce0d3a4d18c 100644 --- a/tests/third_party/cupy/core_tests/test_dlpack.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_dlpack.py @@ -6,7 +6,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing def _gen_array(dtype, alloc_q=None): diff --git a/tests/third_party/cupy/core_tests/test_flags.py b/dpnp/tests/third_party/cupy/core_tests/test_flags.py similarity index 97% rename from tests/third_party/cupy/core_tests/test_flags.py rename to dpnp/tests/third_party/cupy/core_tests/test_flags.py index c945fe38c7e5..9dbccfbf0c4e 100644 --- a/tests/third_party/cupy/core_tests/test_flags.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_flags.py @@ -4,7 +4,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing @pytest.mark.skip("class Flags is not exposed") diff --git a/tests/third_party/cupy/core_tests/test_ndarray.py b/dpnp/tests/third_party/cupy/core_tests/test_ndarray.py similarity index 99% rename from tests/third_party/cupy/core_tests/test_ndarray.py rename to dpnp/tests/third_party/cupy/core_tests/test_ndarray.py index 591495ae9f95..da848ec2d222 100644 --- a/tests/third_party/cupy/core_tests/test_ndarray.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_ndarray.py @@ -7,7 +7,7 @@ from dpctl.tensor._numpy_helper import AxisError import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing def get_array_module(*args): diff --git a/tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py b/dpnp/tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py similarity index 98% rename from tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py rename to dpnp/tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py index 8dfe304da294..4d7ee0eb0034 100644 --- a/tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_ndarray_complex_ops.py @@ -4,8 +4,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestConj(unittest.TestCase): diff --git a/tests/third_party/cupy/core_tests/test_ndarray_conversion.py b/dpnp/tests/third_party/cupy/core_tests/test_ndarray_conversion.py similarity index 96% rename from tests/third_party/cupy/core_tests/test_ndarray_conversion.py rename to dpnp/tests/third_party/cupy/core_tests/test_ndarray_conversion.py index 6c5fdba573b2..b6a1a4227198 100644 --- a/tests/third_party/cupy/core_tests/test_ndarray_conversion.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_ndarray_conversion.py @@ -4,7 +4,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing @testing.parameterize( diff --git a/tests/third_party/cupy/core_tests/test_ndarray_copy_and_view.py b/dpnp/tests/third_party/cupy/core_tests/test_ndarray_copy_and_view.py similarity index 99% rename from tests/third_party/cupy/core_tests/test_ndarray_copy_and_view.py rename to dpnp/tests/third_party/cupy/core_tests/test_ndarray_copy_and_view.py index e9b61e7ef94c..0b738acfd97a 100644 --- a/tests/third_party/cupy/core_tests/test_ndarray_copy_and_view.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_ndarray_copy_and_view.py @@ -2,7 +2,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing if numpy.lib.NumpyVersion(numpy.__version__) >= "2.0.0b1": from numpy.exceptions import ComplexWarning diff --git a/tests/third_party/cupy/core_tests/test_ndarray_math.py b/dpnp/tests/third_party/cupy/core_tests/test_ndarray_math.py similarity index 97% rename from tests/third_party/cupy/core_tests/test_ndarray_math.py rename to dpnp/tests/third_party/cupy/core_tests/test_ndarray_math.py index 40ae44174aee..7e98abfc5f21 100644 --- a/tests/third_party/cupy/core_tests/test_ndarray_math.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_ndarray_math.py @@ -3,8 +3,8 @@ import numpy import pytest -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing @testing.parameterize( diff --git a/tests/third_party/cupy/core_tests/test_ndarray_reduction.py b/dpnp/tests/third_party/cupy/core_tests/test_ndarray_reduction.py similarity index 99% rename from tests/third_party/cupy/core_tests/test_ndarray_reduction.py rename to dpnp/tests/third_party/cupy/core_tests/test_ndarray_reduction.py index 5a45278f7daf..802d38354d77 100644 --- a/tests/third_party/cupy/core_tests/test_ndarray_reduction.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_ndarray_reduction.py @@ -6,7 +6,7 @@ import dpnp as cupy # from cupy.core import _accelerator -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing @testing.parameterize( diff --git a/tests/third_party/cupy/core_tests/test_ndarray_unary_op.py b/dpnp/tests/third_party/cupy/core_tests/test_ndarray_unary_op.py similarity index 99% rename from tests/third_party/cupy/core_tests/test_ndarray_unary_op.py rename to dpnp/tests/third_party/cupy/core_tests/test_ndarray_unary_op.py index 37a17b6985d5..18b398262b98 100644 --- a/tests/third_party/cupy/core_tests/test_ndarray_unary_op.py +++ b/dpnp/tests/third_party/cupy/core_tests/test_ndarray_unary_op.py @@ -5,7 +5,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestArrayBoolOp(unittest.TestCase): diff --git a/tests/third_party/cupy/io_tests/__init__.py b/dpnp/tests/third_party/cupy/creation_tests/__init__.py similarity index 100% rename from tests/third_party/cupy/io_tests/__init__.py rename to dpnp/tests/third_party/cupy/creation_tests/__init__.py diff --git a/tests/third_party/cupy/creation_tests/test_basic.py b/dpnp/tests/third_party/cupy/creation_tests/test_basic.py similarity index 99% rename from tests/third_party/cupy/creation_tests/test_basic.py rename to dpnp/tests/third_party/cupy/creation_tests/test_basic.py index b692622eb0ee..8f76696bc5e1 100644 --- a/tests/third_party/cupy/creation_tests/test_basic.py +++ b/dpnp/tests/third_party/cupy/creation_tests/test_basic.py @@ -4,7 +4,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing if numpy.lib.NumpyVersion(numpy.__version__) >= "2.0.0b1": from numpy.exceptions import ComplexWarning diff --git a/tests/third_party/cupy/creation_tests/test_from_data.py b/dpnp/tests/third_party/cupy/creation_tests/test_from_data.py similarity index 99% rename from tests/third_party/cupy/creation_tests/test_from_data.py rename to dpnp/tests/third_party/cupy/creation_tests/test_from_data.py index a2abbf608c79..679f9260fab7 100644 --- a/tests/third_party/cupy/creation_tests/test_from_data.py +++ b/dpnp/tests/third_party/cupy/creation_tests/test_from_data.py @@ -6,8 +6,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestFromData(unittest.TestCase): diff --git a/tests/third_party/cupy/creation_tests/test_matrix.py b/dpnp/tests/third_party/cupy/creation_tests/test_matrix.py similarity index 99% rename from tests/third_party/cupy/creation_tests/test_matrix.py rename to dpnp/tests/third_party/cupy/creation_tests/test_matrix.py index eda1a40b784d..fac3b51fdd7c 100644 --- a/tests/third_party/cupy/creation_tests/test_matrix.py +++ b/dpnp/tests/third_party/cupy/creation_tests/test_matrix.py @@ -4,7 +4,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestMatrix(unittest.TestCase): diff --git a/tests/third_party/cupy/creation_tests/test_ranges.py b/dpnp/tests/third_party/cupy/creation_tests/test_ranges.py similarity index 99% rename from tests/third_party/cupy/creation_tests/test_ranges.py rename to dpnp/tests/third_party/cupy/creation_tests/test_ranges.py index 92c81061b7a1..bb93179ced7a 100644 --- a/tests/third_party/cupy/creation_tests/test_ranges.py +++ b/dpnp/tests/third_party/cupy/creation_tests/test_ranges.py @@ -7,8 +7,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing def skip_int_equality_before_numpy_1_20(names=("dtype",)): diff --git a/tests/third_party/cupy/linalg_tests/__init__.py b/dpnp/tests/third_party/cupy/fft_tests/__init__.py similarity index 100% rename from tests/third_party/cupy/linalg_tests/__init__.py rename to dpnp/tests/third_party/cupy/fft_tests/__init__.py diff --git a/tests/third_party/cupy/fft_tests/test_fft.py b/dpnp/tests/third_party/cupy/fft_tests/test_fft.py similarity index 99% rename from tests/third_party/cupy/fft_tests/test_fft.py rename to dpnp/tests/third_party/cupy/fft_tests/test_fft.py index b647272bbc39..918b6e2a23f8 100644 --- a/tests/third_party/cupy/fft_tests/test_fft.py +++ b/dpnp/tests/third_party/cupy/fft_tests/test_fft.py @@ -4,8 +4,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing @pytest.fixture diff --git a/tests/third_party/cupy/logic_tests/__init__.py b/dpnp/tests/third_party/cupy/indexing_tests/__init__.py similarity index 100% rename from tests/third_party/cupy/logic_tests/__init__.py rename to dpnp/tests/third_party/cupy/indexing_tests/__init__.py diff --git a/tests/third_party/cupy/indexing_tests/test_generate.py b/dpnp/tests/third_party/cupy/indexing_tests/test_generate.py similarity index 99% rename from tests/third_party/cupy/indexing_tests/test_generate.py rename to dpnp/tests/third_party/cupy/indexing_tests/test_generate.py index 9486615a1b18..61d7bf83ac2e 100644 --- a/tests/third_party/cupy/indexing_tests/test_generate.py +++ b/dpnp/tests/third_party/cupy/indexing_tests/test_generate.py @@ -4,7 +4,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestIndices(unittest.TestCase): diff --git a/tests/third_party/cupy/indexing_tests/test_indexing.py b/dpnp/tests/third_party/cupy/indexing_tests/test_indexing.py similarity index 99% rename from tests/third_party/cupy/indexing_tests/test_indexing.py rename to dpnp/tests/third_party/cupy/indexing_tests/test_indexing.py index ca2f9a9cc6cf..3f16209ccf7f 100644 --- a/tests/third_party/cupy/indexing_tests/test_indexing.py +++ b/dpnp/tests/third_party/cupy/indexing_tests/test_indexing.py @@ -4,8 +4,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestIndexing(unittest.TestCase): diff --git a/tests/third_party/cupy/indexing_tests/test_insert.py b/dpnp/tests/third_party/cupy/indexing_tests/test_insert.py similarity index 99% rename from tests/third_party/cupy/indexing_tests/test_insert.py rename to dpnp/tests/third_party/cupy/indexing_tests/test_insert.py index 1b355f8ad082..a60957108c04 100644 --- a/tests/third_party/cupy/indexing_tests/test_insert.py +++ b/dpnp/tests/third_party/cupy/indexing_tests/test_insert.py @@ -4,7 +4,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing @testing.parameterize( diff --git a/tests/third_party/cupy/indexing_tests/test_iterate.py b/dpnp/tests/third_party/cupy/indexing_tests/test_iterate.py similarity index 98% rename from tests/third_party/cupy/indexing_tests/test_iterate.py rename to dpnp/tests/third_party/cupy/indexing_tests/test_iterate.py index 03db6a07ac38..0c18b7759825 100644 --- a/tests/third_party/cupy/indexing_tests/test_iterate.py +++ b/dpnp/tests/third_party/cupy/indexing_tests/test_iterate.py @@ -10,7 +10,7 @@ from numpy import ComplexWarning import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestFlatiter(unittest.TestCase): diff --git a/tests/third_party/cupy/math_tests/__init__.py b/dpnp/tests/third_party/cupy/io_tests/__init__.py similarity index 100% rename from tests/third_party/cupy/math_tests/__init__.py rename to dpnp/tests/third_party/cupy/io_tests/__init__.py diff --git a/tests/third_party/cupy/io_tests/test_base_n.py b/dpnp/tests/third_party/cupy/io_tests/test_base_n.py similarity index 96% rename from tests/third_party/cupy/io_tests/test_base_n.py rename to dpnp/tests/third_party/cupy/io_tests/test_base_n.py index 46997d7ff715..a4964e8379c8 100644 --- a/tests/third_party/cupy/io_tests/test_base_n.py +++ b/dpnp/tests/third_party/cupy/io_tests/test_base_n.py @@ -1,6 +1,6 @@ import pytest -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestBinaryRepr(testing.NumpyAliasBasicTestBase): diff --git a/tests/third_party/cupy/misc_tests/__init__.py b/dpnp/tests/third_party/cupy/lib_tests/__init__.py similarity index 100% rename from tests/third_party/cupy/misc_tests/__init__.py rename to dpnp/tests/third_party/cupy/lib_tests/__init__.py diff --git a/tests/third_party/cupy/lib_tests/test_shape_base.py b/dpnp/tests/third_party/cupy/lib_tests/test_shape_base.py similarity index 98% rename from tests/third_party/cupy/lib_tests/test_shape_base.py rename to dpnp/tests/third_party/cupy/lib_tests/test_shape_base.py index 7a41c63e2fa1..c4063a569289 100644 --- a/tests/third_party/cupy/lib_tests/test_shape_base.py +++ b/dpnp/tests/third_party/cupy/lib_tests/test_shape_base.py @@ -5,8 +5,8 @@ from dpctl.tensor._numpy_helper import AxisError import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing @testing.parameterize(*(testing.product({"axis": [0, 1, -1]}))) diff --git a/tests/third_party/cupy/padding_tests/__init__.py b/dpnp/tests/third_party/cupy/linalg_tests/__init__.py similarity index 100% rename from tests/third_party/cupy/padding_tests/__init__.py rename to dpnp/tests/third_party/cupy/linalg_tests/__init__.py diff --git a/tests/third_party/cupy/linalg_tests/test_decomposition.py b/dpnp/tests/third_party/cupy/linalg_tests/test_decomposition.py similarity index 98% rename from tests/third_party/cupy/linalg_tests/test_decomposition.py rename to dpnp/tests/third_party/cupy/linalg_tests/test_decomposition.py index 31e693c137e7..d2c3ac69aacc 100644 --- a/tests/third_party/cupy/linalg_tests/test_decomposition.py +++ b/dpnp/tests/third_party/cupy/linalg_tests/test_decomposition.py @@ -4,9 +4,13 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64, is_cpu_device, is_win_platform -from tests.third_party.cupy import testing -from tests.third_party.cupy.testing import _condition +from dpnp.tests.helper import ( + has_support_aspect64, + is_cpu_device, + is_win_platform, +) +from dpnp.tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy.testing import _condition def random_matrix(shape, dtype, scale, sym=False): diff --git a/tests/third_party/cupy/linalg_tests/test_eigenvalue.py b/dpnp/tests/third_party/cupy/linalg_tests/test_eigenvalue.py similarity index 98% rename from tests/third_party/cupy/linalg_tests/test_eigenvalue.py rename to dpnp/tests/third_party/cupy/linalg_tests/test_eigenvalue.py index be8e2bbed9d6..60c8db40ba0f 100644 --- a/tests/third_party/cupy/linalg_tests/test_eigenvalue.py +++ b/dpnp/tests/third_party/cupy/linalg_tests/test_eigenvalue.py @@ -2,8 +2,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing def _get_hermitian(xp, a, UPLO): diff --git a/tests/third_party/cupy/linalg_tests/test_einsum.py b/dpnp/tests/third_party/cupy/linalg_tests/test_einsum.py similarity index 99% rename from tests/third_party/cupy/linalg_tests/test_einsum.py rename to dpnp/tests/third_party/cupy/linalg_tests/test_einsum.py index 20107b7a3b30..8b0510e8a61a 100644 --- a/tests/third_party/cupy/linalg_tests/test_einsum.py +++ b/dpnp/tests/third_party/cupy/linalg_tests/test_einsum.py @@ -4,8 +4,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing rng = numpy.random.default_rng(seed=0) diff --git a/tests/third_party/cupy/linalg_tests/test_norms.py b/dpnp/tests/third_party/cupy/linalg_tests/test_norms.py similarity index 98% rename from tests/third_party/cupy/linalg_tests/test_norms.py rename to dpnp/tests/third_party/cupy/linalg_tests/test_norms.py index aacc54295611..786428707a87 100644 --- a/tests/third_party/cupy/linalg_tests/test_norms.py +++ b/dpnp/tests/third_party/cupy/linalg_tests/test_norms.py @@ -4,8 +4,8 @@ import pytest import dpnp as cupy -from tests.helper import is_cpu_device -from tests.third_party.cupy import testing +from dpnp.tests.helper import is_cpu_device +from dpnp.tests.third_party.cupy import testing class TestTrace(unittest.TestCase): diff --git a/tests/third_party/cupy/linalg_tests/test_product.py b/dpnp/tests/third_party/cupy/linalg_tests/test_product.py similarity index 99% rename from tests/third_party/cupy/linalg_tests/test_product.py rename to dpnp/tests/third_party/cupy/linalg_tests/test_product.py index 35f2be8e2407..7063153b447b 100644 --- a/tests/third_party/cupy/linalg_tests/test_product.py +++ b/dpnp/tests/third_party/cupy/linalg_tests/test_product.py @@ -4,8 +4,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing @testing.parameterize( diff --git a/tests/third_party/cupy/linalg_tests/test_solve.py b/dpnp/tests/third_party/cupy/linalg_tests/test_solve.py similarity index 98% rename from tests/third_party/cupy/linalg_tests/test_solve.py rename to dpnp/tests/third_party/cupy/linalg_tests/test_solve.py index d7204f7d4c14..697a977a6489 100644 --- a/tests/third_party/cupy/linalg_tests/test_solve.py +++ b/dpnp/tests/third_party/cupy/linalg_tests/test_solve.py @@ -4,12 +4,12 @@ import pytest import dpnp as cupy -from tests.helper import ( +from dpnp.tests.helper import ( assert_dtype_allclose, has_support_aspect64, ) -from tests.third_party.cupy import testing -from tests.third_party.cupy.testing import _condition +from dpnp.tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy.testing import _condition @testing.parameterize( diff --git a/tests/third_party/cupy/random_tests/__init__.py b/dpnp/tests/third_party/cupy/logic_tests/__init__.py similarity index 100% rename from tests/third_party/cupy/random_tests/__init__.py rename to dpnp/tests/third_party/cupy/logic_tests/__init__.py diff --git a/tests/third_party/cupy/logic_tests/test_comparison.py b/dpnp/tests/third_party/cupy/logic_tests/test_comparison.py similarity index 99% rename from tests/third_party/cupy/logic_tests/test_comparison.py rename to dpnp/tests/third_party/cupy/logic_tests/test_comparison.py index 571967ff6228..7e56ed5b64bf 100644 --- a/tests/third_party/cupy/logic_tests/test_comparison.py +++ b/dpnp/tests/third_party/cupy/logic_tests/test_comparison.py @@ -5,7 +5,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestComparison(unittest.TestCase): diff --git a/tests/third_party/cupy/logic_tests/test_content.py b/dpnp/tests/third_party/cupy/logic_tests/test_content.py similarity index 95% rename from tests/third_party/cupy/logic_tests/test_content.py rename to dpnp/tests/third_party/cupy/logic_tests/test_content.py index 59f64cdc8dec..dc73551399b5 100644 --- a/tests/third_party/cupy/logic_tests/test_content.py +++ b/dpnp/tests/third_party/cupy/logic_tests/test_content.py @@ -2,7 +2,7 @@ import numpy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestContent(unittest.TestCase): diff --git a/tests/third_party/cupy/logic_tests/test_ops.py b/dpnp/tests/third_party/cupy/logic_tests/test_ops.py similarity index 94% rename from tests/third_party/cupy/logic_tests/test_ops.py rename to dpnp/tests/third_party/cupy/logic_tests/test_ops.py index ab2b97a6246d..41fe9dfb618e 100644 --- a/tests/third_party/cupy/logic_tests/test_ops.py +++ b/dpnp/tests/third_party/cupy/logic_tests/test_ops.py @@ -1,6 +1,6 @@ import unittest -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestOps(unittest.TestCase): diff --git a/tests/third_party/cupy/logic_tests/test_truth.py b/dpnp/tests/third_party/cupy/logic_tests/test_truth.py similarity index 98% rename from tests/third_party/cupy/logic_tests/test_truth.py rename to dpnp/tests/third_party/cupy/logic_tests/test_truth.py index c76ccd48aa58..512e35a27763 100644 --- a/tests/third_party/cupy/logic_tests/test_truth.py +++ b/dpnp/tests/third_party/cupy/logic_tests/test_truth.py @@ -2,7 +2,7 @@ import numpy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing def _calc_out_shape(shape, axis, keepdims): diff --git a/tests/third_party/cupy/logic_tests/test_type_test.py b/dpnp/tests/third_party/cupy/logic_tests/test_type_test.py similarity index 94% rename from tests/third_party/cupy/logic_tests/test_type_test.py rename to dpnp/tests/third_party/cupy/logic_tests/test_type_test.py index c5304e134fd9..599e0e16817a 100644 --- a/tests/third_party/cupy/logic_tests/test_type_test.py +++ b/dpnp/tests/third_party/cupy/logic_tests/test_type_test.py @@ -4,7 +4,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestIsScalar(testing.NumpyAliasBasicTestBase): diff --git a/tests/third_party/cupy/sorting_tests/__init__.py b/dpnp/tests/third_party/cupy/manipulation_tests/__init__.py similarity index 100% rename from tests/third_party/cupy/sorting_tests/__init__.py rename to dpnp/tests/third_party/cupy/manipulation_tests/__init__.py diff --git a/tests/third_party/cupy/manipulation_tests/test_add_remove.py b/dpnp/tests/third_party/cupy/manipulation_tests/test_add_remove.py similarity index 98% rename from tests/third_party/cupy/manipulation_tests/test_add_remove.py rename to dpnp/tests/third_party/cupy/manipulation_tests/test_add_remove.py index c5cf365b3ad5..ab5550895065 100644 --- a/tests/third_party/cupy/manipulation_tests/test_add_remove.py +++ b/dpnp/tests/third_party/cupy/manipulation_tests/test_add_remove.py @@ -4,9 +4,9 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing -from tests.third_party.cupy.testing._loops import ( +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy.testing._loops import ( _complex_dtypes, _regular_float_dtypes, ) diff --git a/tests/third_party/cupy/manipulation_tests/test_basic.py b/dpnp/tests/third_party/cupy/manipulation_tests/test_basic.py similarity index 99% rename from tests/third_party/cupy/manipulation_tests/test_basic.py rename to dpnp/tests/third_party/cupy/manipulation_tests/test_basic.py index 00c6d4bcb88e..4cba30bdba78 100644 --- a/tests/third_party/cupy/manipulation_tests/test_basic.py +++ b/dpnp/tests/third_party/cupy/manipulation_tests/test_basic.py @@ -10,7 +10,7 @@ from numpy import ComplexWarning import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestBasic: diff --git a/tests/third_party/cupy/manipulation_tests/test_dims.py b/dpnp/tests/third_party/cupy/manipulation_tests/test_dims.py similarity index 99% rename from tests/third_party/cupy/manipulation_tests/test_dims.py rename to dpnp/tests/third_party/cupy/manipulation_tests/test_dims.py index bbfac44628c1..56d300447736 100644 --- a/tests/third_party/cupy/manipulation_tests/test_dims.py +++ b/dpnp/tests/third_party/cupy/manipulation_tests/test_dims.py @@ -5,7 +5,7 @@ from dpctl.tensor._numpy_helper import AxisError import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestDims(unittest.TestCase): diff --git a/tests/third_party/cupy/manipulation_tests/test_join.py b/dpnp/tests/third_party/cupy/manipulation_tests/test_join.py similarity index 99% rename from tests/third_party/cupy/manipulation_tests/test_join.py rename to dpnp/tests/third_party/cupy/manipulation_tests/test_join.py index d307b24fcaaa..5e1cfe4647b1 100644 --- a/tests/third_party/cupy/manipulation_tests/test_join.py +++ b/dpnp/tests/third_party/cupy/manipulation_tests/test_join.py @@ -7,8 +7,8 @@ from numpy import AxisError, ComplexWarning import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestJoin: diff --git a/tests/third_party/cupy/manipulation_tests/test_kind.py b/dpnp/tests/third_party/cupy/manipulation_tests/test_kind.py similarity index 97% rename from tests/third_party/cupy/manipulation_tests/test_kind.py rename to dpnp/tests/third_party/cupy/manipulation_tests/test_kind.py index 4c74671e29b0..7acf31b715c8 100644 --- a/tests/third_party/cupy/manipulation_tests/test_kind.py +++ b/dpnp/tests/third_party/cupy/manipulation_tests/test_kind.py @@ -4,8 +4,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestKind(unittest.TestCase): diff --git a/tests/third_party/cupy/manipulation_tests/test_rearrange.py b/dpnp/tests/third_party/cupy/manipulation_tests/test_rearrange.py similarity index 99% rename from tests/third_party/cupy/manipulation_tests/test_rearrange.py rename to dpnp/tests/third_party/cupy/manipulation_tests/test_rearrange.py index 2041e9df840b..4225902c2685 100644 --- a/tests/third_party/cupy/manipulation_tests/test_rearrange.py +++ b/dpnp/tests/third_party/cupy/manipulation_tests/test_rearrange.py @@ -4,7 +4,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing @testing.parameterize( diff --git a/tests/third_party/cupy/manipulation_tests/test_shape.py b/dpnp/tests/third_party/cupy/manipulation_tests/test_shape.py similarity index 98% rename from tests/third_party/cupy/manipulation_tests/test_shape.py rename to dpnp/tests/third_party/cupy/manipulation_tests/test_shape.py index 3169d502e2e4..b09a39c657d0 100644 --- a/tests/third_party/cupy/manipulation_tests/test_shape.py +++ b/dpnp/tests/third_party/cupy/manipulation_tests/test_shape.py @@ -2,8 +2,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing @pytest.mark.parametrize("shape", [(2, 3), (), (4,)]) diff --git a/tests/third_party/cupy/manipulation_tests/test_split.py b/dpnp/tests/third_party/cupy/manipulation_tests/test_split.py similarity index 98% rename from tests/third_party/cupy/manipulation_tests/test_split.py rename to dpnp/tests/third_party/cupy/manipulation_tests/test_split.py index c7e7a59ae9b1..07d5c0546f67 100644 --- a/tests/third_party/cupy/manipulation_tests/test_split.py +++ b/dpnp/tests/third_party/cupy/manipulation_tests/test_split.py @@ -1,7 +1,7 @@ import unittest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestSplit(unittest.TestCase): diff --git a/tests/third_party/cupy/manipulation_tests/test_tiling.py b/dpnp/tests/third_party/cupy/manipulation_tests/test_tiling.py similarity index 98% rename from tests/third_party/cupy/manipulation_tests/test_tiling.py rename to dpnp/tests/third_party/cupy/manipulation_tests/test_tiling.py index 365a01f7e142..63d1144e0148 100644 --- a/tests/third_party/cupy/manipulation_tests/test_tiling.py +++ b/dpnp/tests/third_party/cupy/manipulation_tests/test_tiling.py @@ -4,7 +4,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing @testing.parameterize( diff --git a/tests/third_party/cupy/manipulation_tests/test_transpose.py b/dpnp/tests/third_party/cupy/manipulation_tests/test_transpose.py similarity index 99% rename from tests/third_party/cupy/manipulation_tests/test_transpose.py rename to dpnp/tests/third_party/cupy/manipulation_tests/test_transpose.py index 52203f24e37d..af8b2f3978fc 100644 --- a/tests/third_party/cupy/manipulation_tests/test_transpose.py +++ b/dpnp/tests/third_party/cupy/manipulation_tests/test_transpose.py @@ -5,7 +5,7 @@ from dpctl.tensor._numpy_helper import AxisError import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestTranspose(unittest.TestCase): diff --git a/tests/third_party/cupy/statistics_tests/__init__.py b/dpnp/tests/third_party/cupy/math_tests/__init__.py similarity index 100% rename from tests/third_party/cupy/statistics_tests/__init__.py rename to dpnp/tests/third_party/cupy/math_tests/__init__.py diff --git a/tests/third_party/cupy/math_tests/test_arithmetic.py b/dpnp/tests/third_party/cupy/math_tests/test_arithmetic.py similarity index 99% rename from tests/third_party/cupy/math_tests/test_arithmetic.py rename to dpnp/tests/third_party/cupy/math_tests/test_arithmetic.py index ffbad20aadf0..924c72c7ccea 100644 --- a/tests/third_party/cupy/math_tests/test_arithmetic.py +++ b/dpnp/tests/third_party/cupy/math_tests/test_arithmetic.py @@ -10,8 +10,8 @@ from numpy import ComplexWarning import dpnp as cupy -from tests.helper import has_support_aspect16, has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect16, has_support_aspect64 +from dpnp.tests.third_party.cupy import testing float_types = [numpy.float16, numpy.float32, numpy.float64] complex_types = [numpy.complex64, numpy.complex128] diff --git a/tests/third_party/cupy/math_tests/test_explog.py b/dpnp/tests/third_party/cupy/math_tests/test_explog.py similarity index 95% rename from tests/third_party/cupy/math_tests/test_explog.py rename to dpnp/tests/third_party/cupy/math_tests/test_explog.py index 1585499cd8ce..b8da9575b44e 100644 --- a/tests/third_party/cupy/math_tests/test_explog.py +++ b/dpnp/tests/third_party/cupy/math_tests/test_explog.py @@ -3,8 +3,8 @@ import numpy import pytest -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestExplog: diff --git a/tests/third_party/cupy/math_tests/test_floating.py b/dpnp/tests/third_party/cupy/math_tests/test_floating.py similarity index 96% rename from tests/third_party/cupy/math_tests/test_floating.py rename to dpnp/tests/third_party/cupy/math_tests/test_floating.py index b9e71391bbd2..5042953caf52 100644 --- a/tests/third_party/cupy/math_tests/test_floating.py +++ b/dpnp/tests/third_party/cupy/math_tests/test_floating.py @@ -4,8 +4,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestFloating(unittest.TestCase): diff --git a/tests/third_party/cupy/math_tests/test_hyperbolic.py b/dpnp/tests/third_party/cupy/math_tests/test_hyperbolic.py similarity index 91% rename from tests/third_party/cupy/math_tests/test_hyperbolic.py rename to dpnp/tests/third_party/cupy/math_tests/test_hyperbolic.py index 7d7fa6a6b13d..34f7cc2250dd 100644 --- a/tests/third_party/cupy/math_tests/test_hyperbolic.py +++ b/dpnp/tests/third_party/cupy/math_tests/test_hyperbolic.py @@ -1,7 +1,7 @@ import unittest -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestHyperbolic(unittest.TestCase): diff --git a/tests/third_party/cupy/math_tests/test_matmul.py b/dpnp/tests/third_party/cupy/math_tests/test_matmul.py similarity index 99% rename from tests/third_party/cupy/math_tests/test_matmul.py rename to dpnp/tests/third_party/cupy/math_tests/test_matmul.py index d1ebd718a617..fe2e833882c7 100644 --- a/tests/third_party/cupy/math_tests/test_matmul.py +++ b/dpnp/tests/third_party/cupy/math_tests/test_matmul.py @@ -5,8 +5,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing @testing.parameterize( diff --git a/tests/third_party/cupy/math_tests/test_misc.py b/dpnp/tests/third_party/cupy/math_tests/test_misc.py similarity index 99% rename from tests/third_party/cupy/math_tests/test_misc.py rename to dpnp/tests/third_party/cupy/math_tests/test_misc.py index 05254f712877..67a66ebf7755 100644 --- a/tests/third_party/cupy/math_tests/test_misc.py +++ b/dpnp/tests/third_party/cupy/math_tests/test_misc.py @@ -2,8 +2,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestMisc: diff --git a/tests/third_party/cupy/math_tests/test_rational.py b/dpnp/tests/third_party/cupy/math_tests/test_rational.py similarity index 96% rename from tests/third_party/cupy/math_tests/test_rational.py rename to dpnp/tests/third_party/cupy/math_tests/test_rational.py index 6dd2a863a4ca..218bd7918050 100644 --- a/tests/third_party/cupy/math_tests/test_rational.py +++ b/dpnp/tests/third_party/cupy/math_tests/test_rational.py @@ -3,7 +3,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestRational(unittest.TestCase): diff --git a/tests/third_party/cupy/math_tests/test_rounding.py b/dpnp/tests/third_party/cupy/math_tests/test_rounding.py similarity index 98% rename from tests/third_party/cupy/math_tests/test_rounding.py rename to dpnp/tests/third_party/cupy/math_tests/test_rounding.py index 74ebf8e745f8..54a379490865 100644 --- a/tests/third_party/cupy/math_tests/test_rounding.py +++ b/dpnp/tests/third_party/cupy/math_tests/test_rounding.py @@ -4,8 +4,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestRounding(unittest.TestCase): diff --git a/tests/third_party/cupy/math_tests/test_special.py b/dpnp/tests/third_party/cupy/math_tests/test_special.py similarity index 95% rename from tests/third_party/cupy/math_tests/test_special.py rename to dpnp/tests/third_party/cupy/math_tests/test_special.py index 7699b96fa567..8c6753e12c35 100644 --- a/tests/third_party/cupy/math_tests/test_special.py +++ b/dpnp/tests/third_party/cupy/math_tests/test_special.py @@ -3,7 +3,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestSpecial(unittest.TestCase): diff --git a/tests/third_party/cupy/math_tests/test_sumprod.py b/dpnp/tests/third_party/cupy/math_tests/test_sumprod.py similarity index 99% rename from tests/third_party/cupy/math_tests/test_sumprod.py rename to dpnp/tests/third_party/cupy/math_tests/test_sumprod.py index a35b575178e1..cc482cabea95 100644 --- a/tests/third_party/cupy/math_tests/test_sumprod.py +++ b/dpnp/tests/third_party/cupy/math_tests/test_sumprod.py @@ -6,11 +6,11 @@ from dpctl.tensor._numpy_helper import AxisError import dpnp as cupy -from tests.helper import ( +from dpnp.tests.helper import ( has_support_aspect16, has_support_aspect64, ) -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestSumprod: diff --git a/tests/third_party/cupy/math_tests/test_trigonometric.py b/dpnp/tests/third_party/cupy/math_tests/test_trigonometric.py similarity index 97% rename from tests/third_party/cupy/math_tests/test_trigonometric.py rename to dpnp/tests/third_party/cupy/math_tests/test_trigonometric.py index ea1881662efc..9161b0898603 100644 --- a/tests/third_party/cupy/math_tests/test_trigonometric.py +++ b/dpnp/tests/third_party/cupy/math_tests/test_trigonometric.py @@ -1,7 +1,7 @@ import unittest -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestTrigonometric(unittest.TestCase): diff --git a/dpnp/tests/third_party/cupy/misc_tests/__init__.py b/dpnp/tests/third_party/cupy/misc_tests/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/third_party/cupy/misc_tests/test_byte_bounds.py b/dpnp/tests/third_party/cupy/misc_tests/test_byte_bounds.py similarity index 100% rename from tests/third_party/cupy/misc_tests/test_byte_bounds.py rename to dpnp/tests/third_party/cupy/misc_tests/test_byte_bounds.py diff --git a/dpnp/tests/third_party/cupy/padding_tests/__init__.py b/dpnp/tests/third_party/cupy/padding_tests/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/third_party/cupy/padding_tests/test_pad.py b/dpnp/tests/third_party/cupy/padding_tests/test_pad.py similarity index 99% rename from tests/third_party/cupy/padding_tests/test_pad.py rename to dpnp/tests/third_party/cupy/padding_tests/test_pad.py index 1521a3729a7f..f12eb18a6b97 100644 --- a/tests/third_party/cupy/padding_tests/test_pad.py +++ b/dpnp/tests/third_party/cupy/padding_tests/test_pad.py @@ -5,8 +5,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing if numpy.lib.NumpyVersion(numpy.__version__) >= "2.0.0b1": from numpy.exceptions import ComplexWarning diff --git a/dpnp/tests/third_party/cupy/random_tests/__init__.py b/dpnp/tests/third_party/cupy/random_tests/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/third_party/cupy/random_tests/test_distributions.py b/dpnp/tests/third_party/cupy/random_tests/test_distributions.py similarity index 99% rename from tests/third_party/cupy/random_tests/test_distributions.py rename to dpnp/tests/third_party/cupy/random_tests/test_distributions.py index d73fa9961395..feda42d6ead5 100644 --- a/tests/third_party/cupy/random_tests/test_distributions.py +++ b/dpnp/tests/third_party/cupy/random_tests/test_distributions.py @@ -5,8 +5,8 @@ import dpnp as cupy from dpnp import random as _distributions -from tests.third_party.cupy import testing -from tests.third_party.cupy.testing import _helper, _loops +from dpnp.tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy.testing import _helper, _loops _regular_float_dtypes = (numpy.float64, numpy.float32) _float_dtypes = _regular_float_dtypes + (numpy.float16,) diff --git a/tests/third_party/cupy/random_tests/test_sample.py b/dpnp/tests/third_party/cupy/random_tests/test_sample.py similarity index 98% rename from tests/third_party/cupy/random_tests/test_sample.py rename to dpnp/tests/third_party/cupy/random_tests/test_sample.py index 2ef8f2605e5d..8ce99ca4fdf5 100644 --- a/tests/third_party/cupy/random_tests/test_sample.py +++ b/dpnp/tests/third_party/cupy/random_tests/test_sample.py @@ -6,8 +6,8 @@ import dpnp as cupy from dpnp import random -from tests.third_party.cupy import testing -from tests.third_party.cupy.testing import _condition, _hypothesis +from dpnp.tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy.testing import _condition, _hypothesis class TestRandint(unittest.TestCase): diff --git a/dpnp/tests/third_party/cupy/sorting_tests/__init__.py b/dpnp/tests/third_party/cupy/sorting_tests/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/third_party/cupy/sorting_tests/test_count.py b/dpnp/tests/third_party/cupy/sorting_tests/test_count.py similarity index 97% rename from tests/third_party/cupy/sorting_tests/test_count.py rename to dpnp/tests/third_party/cupy/sorting_tests/test_count.py index 117f3be94f66..b4e8be11fc77 100644 --- a/tests/third_party/cupy/sorting_tests/test_count.py +++ b/dpnp/tests/third_party/cupy/sorting_tests/test_count.py @@ -3,7 +3,7 @@ import numpy import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestCount(unittest.TestCase): diff --git a/tests/third_party/cupy/sorting_tests/test_search.py b/dpnp/tests/third_party/cupy/sorting_tests/test_search.py similarity index 99% rename from tests/third_party/cupy/sorting_tests/test_search.py rename to dpnp/tests/third_party/cupy/sorting_tests/test_search.py index 9b34ba14312e..b2b201bd7b6a 100644 --- a/tests/third_party/cupy/sorting_tests/test_search.py +++ b/dpnp/tests/third_party/cupy/sorting_tests/test_search.py @@ -2,8 +2,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestSearch: diff --git a/tests/third_party/cupy/sorting_tests/test_sort.py b/dpnp/tests/third_party/cupy/sorting_tests/test_sort.py similarity index 99% rename from tests/third_party/cupy/sorting_tests/test_sort.py rename to dpnp/tests/third_party/cupy/sorting_tests/test_sort.py index 5a90a8df2789..3d4eafa72046 100644 --- a/tests/third_party/cupy/sorting_tests/test_sort.py +++ b/dpnp/tests/third_party/cupy/sorting_tests/test_sort.py @@ -5,8 +5,8 @@ from dpctl.tensor._numpy_helper import AxisError import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing def get_array_module(*args): diff --git a/dpnp/tests/third_party/cupy/statistics_tests/__init__.py b/dpnp/tests/third_party/cupy/statistics_tests/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/third_party/cupy/statistics_tests/test_correlation.py b/dpnp/tests/third_party/cupy/statistics_tests/test_correlation.py similarity index 98% rename from tests/third_party/cupy/statistics_tests/test_correlation.py rename to dpnp/tests/third_party/cupy/statistics_tests/test_correlation.py index 2a4cef5f8c55..2b2f846bb71e 100644 --- a/tests/third_party/cupy/statistics_tests/test_correlation.py +++ b/dpnp/tests/third_party/cupy/statistics_tests/test_correlation.py @@ -6,8 +6,8 @@ from dpctl import select_default_device import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing class TestCorrcoef(unittest.TestCase): diff --git a/tests/third_party/cupy/statistics_tests/test_histogram.py b/dpnp/tests/third_party/cupy/statistics_tests/test_histogram.py similarity index 99% rename from tests/third_party/cupy/statistics_tests/test_histogram.py rename to dpnp/tests/third_party/cupy/statistics_tests/test_histogram.py index 29c02c2ea5d8..88832a070aa4 100644 --- a/tests/third_party/cupy/statistics_tests/test_histogram.py +++ b/dpnp/tests/third_party/cupy/statistics_tests/test_histogram.py @@ -5,8 +5,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing # Note that numpy.bincount does not support uint64 on 64-bit environment # as it casts an input array to intp. diff --git a/tests/third_party/cupy/statistics_tests/test_meanvar.py b/dpnp/tests/third_party/cupy/statistics_tests/test_meanvar.py similarity index 99% rename from tests/third_party/cupy/statistics_tests/test_meanvar.py rename to dpnp/tests/third_party/cupy/statistics_tests/test_meanvar.py index 465d0e8e5113..ffed230eb822 100644 --- a/tests/third_party/cupy/statistics_tests/test_meanvar.py +++ b/dpnp/tests/third_party/cupy/statistics_tests/test_meanvar.py @@ -3,8 +3,8 @@ from dpctl.tensor._numpy_helper import AxisError import dpnp as cupy -from tests.helper import has_support_aspect16, has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect16, has_support_aspect64 +from dpnp.tests.third_party.cupy import testing ignore_runtime_warnings = pytest.mark.filterwarnings( "ignore", category=RuntimeWarning diff --git a/tests/third_party/cupy/statistics_tests/test_order.py b/dpnp/tests/third_party/cupy/statistics_tests/test_order.py similarity index 99% rename from tests/third_party/cupy/statistics_tests/test_order.py rename to dpnp/tests/third_party/cupy/statistics_tests/test_order.py index 3805933d4902..7bffc360c01a 100644 --- a/tests/third_party/cupy/statistics_tests/test_order.py +++ b/dpnp/tests/third_party/cupy/statistics_tests/test_order.py @@ -4,7 +4,7 @@ import pytest import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing _all_methods = ( # "inverted_cdf", # TODO(takagi) Not implemented diff --git a/tests/third_party/cupy/test_ndim.py b/dpnp/tests/third_party/cupy/test_ndim.py similarity index 97% rename from tests/third_party/cupy/test_ndim.py rename to dpnp/tests/third_party/cupy/test_ndim.py index 0323ebb9794a..13fd811a9904 100644 --- a/tests/third_party/cupy/test_ndim.py +++ b/dpnp/tests/third_party/cupy/test_ndim.py @@ -3,7 +3,7 @@ import numpy import dpnp as cupy -from tests.third_party.cupy import testing +from dpnp.tests.third_party.cupy import testing class TestNdim(unittest.TestCase): diff --git a/tests/third_party/cupy/test_type_routines.py b/dpnp/tests/third_party/cupy/test_type_routines.py similarity index 97% rename from tests/third_party/cupy/test_type_routines.py rename to dpnp/tests/third_party/cupy/test_type_routines.py index c1e39a19cd02..c9ebfeb950c3 100644 --- a/tests/third_party/cupy/test_type_routines.py +++ b/dpnp/tests/third_party/cupy/test_type_routines.py @@ -4,8 +4,8 @@ import pytest import dpnp as cupy -from tests.helper import has_support_aspect64 -from tests.third_party.cupy import testing +from dpnp.tests.helper import has_support_aspect64 +from dpnp.tests.third_party.cupy import testing def _generate_type_routines_input(xp, dtype, obj_type): diff --git a/tests/third_party/cupy/testing/__init__.py b/dpnp/tests/third_party/cupy/testing/__init__.py similarity index 70% rename from tests/third_party/cupy/testing/__init__.py rename to dpnp/tests/third_party/cupy/testing/__init__.py index 99ddf9e50e2d..38877112512d 100644 --- a/tests/third_party/cupy/testing/__init__.py +++ b/dpnp/tests/third_party/cupy/testing/__init__.py @@ -1,4 +1,4 @@ -from tests.third_party.cupy.testing._array import ( +from dpnp.tests.third_party.cupy.testing._array import ( assert_allclose, assert_array_almost_equal, assert_array_almost_equal_nulp, @@ -7,10 +7,10 @@ assert_array_list_equal, assert_array_max_ulp, ) -from tests.third_party.cupy.testing._attr import multi_gpu, slow +from dpnp.tests.third_party.cupy.testing._attr import multi_gpu, slow -# from tests.third_party.cupy.testing._helper import shaped_sparse_random -from tests.third_party.cupy.testing._helper import ( +# from dpnp.tests.third_party.cupy.testing._helper import shaped_sparse_random +from dpnp.tests.third_party.cupy.testing._helper import ( AssertFunctionIsCalled, NumpyAliasBasicTestBase, NumpyAliasValuesTestBase, @@ -23,7 +23,7 @@ shaped_reverse_arange, with_requires, ) -from tests.third_party.cupy.testing._loops import ( +from dpnp.tests.third_party.cupy.testing._loops import ( for_all_dtypes, for_all_dtypes_combination, for_castings, @@ -50,9 +50,12 @@ numpy_cupy_equal, numpy_cupy_raises, ) -from tests.third_party.cupy.testing._parameterized import ( +from dpnp.tests.third_party.cupy.testing._parameterized import ( parameterize, product, product_dict, ) -from tests.third_party.cupy.testing._random import fix_random, generate_seed +from dpnp.tests.third_party.cupy.testing._random import ( + fix_random, + generate_seed, +) diff --git a/tests/third_party/cupy/testing/_array.py b/dpnp/tests/third_party/cupy/testing/_array.py similarity index 100% rename from tests/third_party/cupy/testing/_array.py rename to dpnp/tests/third_party/cupy/testing/_array.py diff --git a/tests/third_party/cupy/testing/_attr.py b/dpnp/tests/third_party/cupy/testing/_attr.py similarity index 94% rename from tests/third_party/cupy/testing/_attr.py rename to dpnp/tests/third_party/cupy/testing/_attr.py index d2cd6605b217..54bb49652560 100644 --- a/tests/third_party/cupy/testing/_attr.py +++ b/dpnp/tests/third_party/cupy/testing/_attr.py @@ -1,6 +1,6 @@ import os -from tests.third_party.cupy.testing._pytest_impl import ( +from dpnp.tests.third_party.cupy.testing._pytest_impl import ( check_available, is_available, ) diff --git a/tests/third_party/cupy/testing/_bundle.py b/dpnp/tests/third_party/cupy/testing/_bundle.py similarity index 100% rename from tests/third_party/cupy/testing/_bundle.py rename to dpnp/tests/third_party/cupy/testing/_bundle.py diff --git a/tests/third_party/cupy/testing/_condition.py b/dpnp/tests/third_party/cupy/testing/_condition.py similarity index 100% rename from tests/third_party/cupy/testing/_condition.py rename to dpnp/tests/third_party/cupy/testing/_condition.py diff --git a/tests/third_party/cupy/testing/_helper.py b/dpnp/tests/third_party/cupy/testing/_helper.py similarity index 99% rename from tests/third_party/cupy/testing/_helper.py rename to dpnp/tests/third_party/cupy/testing/_helper.py index 38a347e1561f..5414c7af2cab 100644 --- a/tests/third_party/cupy/testing/_helper.py +++ b/dpnp/tests/third_party/cupy/testing/_helper.py @@ -10,7 +10,7 @@ import numpy import dpnp as cupy -from tests.third_party.cupy.testing._pytest_impl import is_available +from dpnp.tests.third_party.cupy.testing._pytest_impl import is_available # from cupy._core import internal # import cupyx diff --git a/tests/third_party/cupy/testing/_hypothesis.py b/dpnp/tests/third_party/cupy/testing/_hypothesis.py similarity index 100% rename from tests/third_party/cupy/testing/_hypothesis.py rename to dpnp/tests/third_party/cupy/testing/_hypothesis.py diff --git a/tests/third_party/cupy/testing/_loops.py b/dpnp/tests/third_party/cupy/testing/_loops.py similarity index 99% rename from tests/third_party/cupy/testing/_loops.py rename to dpnp/tests/third_party/cupy/testing/_loops.py index f8ae6de9dadf..aea6e77e042c 100644 --- a/tests/third_party/cupy/testing/_loops.py +++ b/dpnp/tests/third_party/cupy/testing/_loops.py @@ -12,8 +12,8 @@ from dpctl.tensor._numpy_helper import AxisError import dpnp as cupy -from tests.third_party.cupy.testing import _array, _parameterized -from tests.third_party.cupy.testing._pytest_impl import is_available +from dpnp.tests.third_party.cupy.testing import _array, _parameterized +from dpnp.tests.third_party.cupy.testing._pytest_impl import is_available # import cupyx # import cupyx.scipy.sparse diff --git a/tests/third_party/cupy/testing/_parameterized.py b/dpnp/tests/third_party/cupy/testing/_parameterized.py similarity index 97% rename from tests/third_party/cupy/testing/_parameterized.py rename to dpnp/tests/third_party/cupy/testing/_parameterized.py index b965d1c3068c..7bf81353f3c0 100644 --- a/tests/third_party/cupy/testing/_parameterized.py +++ b/dpnp/tests/third_party/cupy/testing/_parameterized.py @@ -2,7 +2,7 @@ import types import unittest -from tests.third_party.cupy.testing import _bundle, _pytest_impl +from dpnp.tests.third_party.cupy.testing import _bundle, _pytest_impl def _param_to_str(obj): diff --git a/tests/third_party/cupy/testing/_pytest_impl.py b/dpnp/tests/third_party/cupy/testing/_pytest_impl.py similarity index 92% rename from tests/third_party/cupy/testing/_pytest_impl.py rename to dpnp/tests/third_party/cupy/testing/_pytest_impl.py index 9e6d0f579333..97dfee5e174a 100644 --- a/tests/third_party/cupy/testing/_pytest_impl.py +++ b/dpnp/tests/third_party/cupy/testing/_pytest_impl.py @@ -1,6 +1,6 @@ import unittest -import tests.third_party.cupy.testing._parameterized +from dpnp.tests.third_party.cupy.testing import _parameterized try: import _pytest @@ -49,9 +49,7 @@ def _cupy_testing_parameterize(self, _cupy_testing_param): def parameterize(*params, _ids=True): check_available("parameterize") if _ids: - param_name = ( - tests.third_party.cupy.testing._parameterized._make_class_name - ) + param_name = _parameterized._make_class_name else: def param_name(_, i, param): diff --git a/tests/third_party/cupy/testing/_random.py b/dpnp/tests/third_party/cupy/testing/_random.py similarity index 100% rename from tests/third_party/cupy/testing/_random.py rename to dpnp/tests/third_party/cupy/testing/_random.py diff --git a/tests/third_party/intel/test_zero_copy_test1.py b/dpnp/tests/third_party/intel/test_zero_copy_test1.py similarity index 100% rename from tests/third_party/intel/test_zero_copy_test1.py rename to dpnp/tests/third_party/intel/test_zero_copy_test1.py diff --git a/tests/third_party/intel/zero-copy-test1.py b/dpnp/tests/third_party/intel/zero-copy-test1.py similarity index 100% rename from tests/third_party/intel/zero-copy-test1.py rename to dpnp/tests/third_party/intel/zero-copy-test1.py diff --git a/tests/third_party/numpy_ext/__init__.py b/dpnp/tests/third_party/numpy_ext/__init__.py similarity index 100% rename from tests/third_party/numpy_ext/__init__.py rename to dpnp/tests/third_party/numpy_ext/__init__.py diff --git a/pyproject.toml b/pyproject.toml index 6c0cb342d446..4863cdc60cf9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,13 +50,13 @@ source = [ "dpnp", ] omit = [ - "tests/*", + "dpnp/tests/*", "dpnp/_version.py", ] [tool.coverage.report] omit = [ - "tests/*", + "dpnp/tests/*", "dpnp/_version.py", ] diff --git a/scripts/gen_coverage.py b/scripts/gen_coverage.py index 348e691fd3cd..89f3f0ce30f6 100644 --- a/scripts/gen_coverage.py +++ b/scripts/gen_coverage.py @@ -70,7 +70,7 @@ def run( "--cov-report", "term-missing", "--pyargs", - "tests", + "dpnp", "-vv", *pytest_opts.split(), ], diff --git a/setup.cfg b/setup.cfg index 8841f74f2908..5b0418d579d1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,23 +2,6 @@ max_line_length = 120 ignore = E201 -[tool:pytest] -# By default, tests marked as slow will be deselected. -# To run all tests, use -m "slow and not slow". -# To run only slow tests, use -m "slow". -addopts = -m "not slow" --tb=short --strict-markers -norecursedirs = tests_perf -testpaths = tests -markers = - slow: marks tests as slow (deselect with '-m "not slow"') - multi_gpu: marks tests that require a specified number of GPUs -filterwarnings = - # NumPy arccosh - # Undefined behavior depends on the backend: - # NumPy with OpenBLAS for np.array[1.0] does not raise a warning - # while numpy with OneMKL raises RuntimeWarning - ignore:invalid value encountered in arccosh:RuntimeWarning - [versioneer] VCS = git versionfile_source = dpnp/_version.py diff --git a/setup.py b/setup.py index fd0ff36b8021..7a2c10a16ba7 100644 --- a/setup.py +++ b/setup.py @@ -46,6 +46,7 @@ def _get_cmdclass(): Operating System :: Unix """ + setup( name="dpnp", version=__version__, @@ -69,10 +70,15 @@ def _get_cmdclass(): ], package_data={ "dpnp": [ + "backend/include/*.hpp", "libdpnp_backend_c.so", "dpnp_backend_c.lib", "dpnp_backend_c.dll", + "tests/*.*", + "tests/testing/*.py", + "tests/third_party/cupy/*.py", + "tests/third_party/cupy/*/*.py", ] }, - include_package_data=True, + include_package_data=False, )