diff --git a/.github/workflows/extremes.yml b/.github/workflows/extremes.yml index 3dcc269a98..e9677c959a 100644 --- a/.github/workflows/extremes.yml +++ b/.github/workflows/extremes.yml @@ -31,6 +31,8 @@ jobs: - name: install-reqs run: | uv pip install -e . --group tests + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show-deps run: uv pip freeze - name: Assert dependencies @@ -44,7 +46,7 @@ jobs: echo "$DEPS" | grep 'scikit-learn==1.1.0' echo "$DEPS" | grep 'duckdb==1.1' - name: Run pytest - run: pytest tests --cov=narwhals --cov=tests --cov-fail-under=50 --runslow --constructors=pandas,pyarrow,polars[eager],polars[lazy],duckdb + run: pytest --cov=narwhals --cov=narwhals-testing/narwhals_testing/tests --cov-fail-under=50 --runslow --constructors=pandas,pyarrow,polars[eager],polars[lazy],duckdb pretty_old_versions: strategy: @@ -67,6 +69,8 @@ jobs: run: uv pip install pipdeptree tox virtualenv setuptools pandas==1.1.5 polars==0.20.4 numpy==1.19.3 pyarrow==14.0.0 "pyarrow-stubs<17" scipy==1.6.0 scikit-learn==1.1.0 duckdb==1.2 tzdata - name: install-reqs run: uv pip install -e . --group tests + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show-deps run: uv pip freeze - name: show-deptree @@ -82,7 +86,7 @@ jobs: echo "$DEPS" | grep 'scikit-learn==1.1.0' echo "$DEPS" | grep 'duckdb==1.2' - name: Run pytest - run: pytest tests --cov=narwhals --cov=tests --cov-fail-under=50 --runslow --constructors=pandas,pyarrow,polars[eager],polars[lazy],duckdb + run: pytest --cov=narwhals --cov=narwhals-testing/narwhals_testing/tests --cov-fail-under=50 --runslow --constructors=pandas,pyarrow,polars[eager],polars[lazy],duckdb not_so_old_versions: strategy: @@ -105,6 +109,8 @@ jobs: run: uv pip install tox virtualenv setuptools pandas==2.0.3 polars==0.20.8 numpy==1.24.4 pyarrow==15.0.0 "pyarrow-stubs<17" scipy==1.8.0 scikit-learn==1.3.0 duckdb==1.3 dask[dataframe]==2024.10 tzdata - name: install-reqs run: uv pip install -e . --group tests + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show-deps run: uv pip freeze - name: Assert not so old versions dependencies @@ -119,7 +125,7 @@ jobs: echo "$DEPS" | grep 'dask==2024.10' echo "$DEPS" | grep 'duckdb==1.3' - name: Run pytest - run: pytest tests --cov=narwhals --cov=tests --cov-fail-under=50 --runslow --constructors=pandas,pyarrow,polars[eager],polars[lazy],dask,duckdb + run: pytest --cov=narwhals --cov=narwhals-testing/narwhals_testing/tests --cov-fail-under=50 --runslow --constructors=pandas,pyarrow,polars[eager],polars[lazy],dask,duckdb nightlies: strategy: @@ -140,6 +146,8 @@ jobs: cache-dependency-glob: "pyproject.toml" - name: install-reqs run: uv pip install -e . --group tests + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: install polars pre-release run: | uv pip uninstall polars @@ -176,5 +184,5 @@ jobs: echo "$DEPS" | grep 'duckdb.*dev' - name: Run pytest run: | - pytest tests --cov=narwhals --cov=tests --cov-fail-under=50 --runslow \ + pytest --cov=narwhals --cov=narwhals-testing/narwhals_testing/tests --cov-fail-under=50 --runslow \ --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow,polars[eager],polars[lazy],dask,duckdb diff --git a/.github/workflows/pytest-ibis.yml b/.github/workflows/pytest-ibis.yml index 2910a597f0..565862dff8 100644 --- a/.github/workflows/pytest-ibis.yml +++ b/.github/workflows/pytest-ibis.yml @@ -33,7 +33,9 @@ jobs: # Temporary pin until it's fixed upstream uv pip install "sqlglot<28.6" uv pip install -e ".[ibis]" + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show-deps run: uv pip freeze - name: Run pytest - run: pytest tests --constructors ibis + run: pytest --constructors ibis diff --git a/.github/workflows/pytest-modin.yml b/.github/workflows/pytest-modin.yml index ff717b2e32..25d5c7caae 100644 --- a/.github/workflows/pytest-modin.yml +++ b/.github/workflows/pytest-modin.yml @@ -31,7 +31,9 @@ jobs: - name: install modin run: | uv pip install -e ".[modin]" + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show-deps run: uv pip freeze - name: Run pytest - run: pytest tests --constructors modin[pyarrow] + run: pytest --constructors modin[pyarrow] diff --git a/.github/workflows/pytest-pyspark.yml b/.github/workflows/pytest-pyspark.yml index 043c630abd..8a0ecf1573 100644 --- a/.github/workflows/pytest-pyspark.yml +++ b/.github/workflows/pytest-pyspark.yml @@ -6,8 +6,8 @@ on: - narwhals/_expression_parsing.py - narwhals/_spark_like/** - narwhals/_sql/** - - tests/*scan*.py - - tests/frame/*sink*.py + - narwhals-testing/narwhals_testing/tests/*scan*.py + - narwhals-testing/narwhals_testing/tests/frame/*sink*.py schedule: - cron: 0 12 * * 0 # Sunday at mid-day @@ -37,10 +37,12 @@ jobs: run: uv pip install -e . --group core-tests - name: install pyspark run: uv pip install -e ".[pyspark]" + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show-deps run: uv pip freeze - name: Run pytest - run: pytest tests --cov=narwhals/_spark_like --cov-fail-under=95 --runslow --constructors pyspark + run: pytest --cov=narwhals/_spark_like --cov-fail-under=95 --runslow --constructors pyspark pytest-pyspark-min-version-constructor: @@ -64,10 +66,12 @@ jobs: run: uv pip install -e . --group core-tests --system - name: install pyspark (min version) run: uv pip install "pyspark==3.5.0" --system + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show-deps run: uv pip freeze - name: Run pytest - run: pytest tests --constructors pyspark + run: pytest --constructors pyspark pytest-pyspark-connect-constructor: strategy: @@ -103,6 +107,8 @@ jobs: run: uv pip install -e . --group core-tests --group extra "pyarrow<22.0" - name: install pyspark run: echo "setuptools<78" | uv pip install -e . "pyspark[connect]==${SPARK_VERSION}" + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show-deps run: uv pip freeze @@ -133,7 +139,7 @@ jobs: echo "Spark Connect server started" - name: Run pytest - run: pytest tests --cov=narwhals/_spark_like --cov-fail-under=95 --runslow --constructors "pyspark[connect]" + run: pytest --cov=narwhals/_spark_like --cov-fail-under=95 --runslow --constructors "pyspark[connect]" - name: Stop Spark Connect server if: always() diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 9f6205d1cc..6e7e832be3 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -29,10 +29,12 @@ jobs: run: uv pip install -e ".[pandas,polars,pyarrow]" --group tests - name: show-deps run: uv pip freeze - - name: Run pytest - run: pytest tests --cov=narwhals --cov=tests --cov-fail-under=75 --constructors=pandas,pyarrow,polars[eager],polars[lazy] - name: install-test-plugin run: uv pip install -e test-plugin/. + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. + - name: Run pytest + run: pytest --cov=narwhals --cov=narwhals-testing/narwhals_testing/tests --cov-fail-under=75 --constructors=pandas,pyarrow,polars[eager],polars[lazy] pytest-windows: strategy: @@ -56,11 +58,13 @@ jobs: run: uv pip install -e "." --group core-tests --group extra - name: install-test-plugin run: uv pip install -e test-plugin/. + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show-deps run: uv pip freeze - name: Run pytest run: | - pytest tests --cov=narwhals --cov=tests --runslow --cov-fail-under=95 --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow,polars[eager],polars[lazy],duckdb,sqlframe --durations=30 + pytest --cov=narwhals --cov=narwhals-testing/narwhals_testing/tests --runslow --cov-fail-under=95 --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow,polars[eager],polars[lazy],duckdb,sqlframe --durations=30 pytest-full-coverage: strategy: @@ -88,10 +92,12 @@ jobs: run: uv pip install -e ".[dask]" --group core-tests --group extra - name: install-test-plugin run: uv pip install -e test-plugin/. + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show-deps run: uv pip freeze - name: Run pytest - run: pytest tests --cov=narwhals --cov=tests --cov-fail-under=100 --runslow --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow,polars[eager],polars[lazy],dask,duckdb,sqlframe --durations=30 + run: pytest --cov=narwhals --cov=narwhals-testing/narwhals_testing/tests --cov-fail-under=100 --runslow --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow,polars[eager],polars[lazy],dask,duckdb,sqlframe --durations=30 - name: Run doctests # reprs differ between versions, so we only run doctests on the latest Python if: matrix.python-version == '3.13' @@ -118,22 +124,23 @@ jobs: - name: install-reqs run: | uv pip install -e ".[pandas]" --group tests + uv pip install -e narwhals-testing/. uv pip freeze - name: Run pytest (pandas and pandas[nullable]) - run: pytest tests --runslow --constructors=pandas,pandas[nullable] + run: pytest --runslow --constructors=pandas,pandas[nullable] - name: install-more-reqs run: | uv pip install -U pyarrow uv pip freeze - name: Run pytest (pandas[pyarrow] and pyarrow) - run: pytest tests --runslow --constructors=pandas[pyarrow],pyarrow + run: pytest --runslow --constructors=pandas[pyarrow],pyarrow - name: install-polars run: | uv pip uninstall pandas pyarrow uv pip install polars uv pip freeze - name: Run pytest (polars) - run: pytest tests --runslow --constructors=polars[eager],polars[lazy] + run: pytest --runslow --constructors=polars[eager],polars[lazy] python-314: strategy: @@ -154,10 +161,12 @@ jobs: cache-dependency-glob: "pyproject.toml" - name: install-reqs run: uv pip install -e . --group tests pandas polars pyarrow duckdb sqlframe + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show-deps run: uv pip freeze - name: Run pytest - run: pytest tests --cov=narwhals --cov=tests --runslow --durations=30 --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow,polars[eager],polars[lazy],duckdb,sqlframe --cov-fail-under=50 + run: pytest --cov=narwhals --cov=narwhals-testing/narwhals_testing/tests --runslow --durations=30 --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow,polars[eager],polars[lazy],duckdb,sqlframe --cov-fail-under=50 python-314t: strategy: @@ -180,7 +189,9 @@ jobs: cache-dependency-glob: "pyproject.toml" - name: install-reqs run: uv pip install -e . --group tests --pre pandas pyarrow + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show-deps run: uv pip freeze - name: Run pytest - run: pytest tests --cov=narwhals --cov=tests --runslow --durations=30 --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow --cov-fail-under=50 + run: pytest --cov=narwhals --cov=narwhals-testing/narwhals_testing/tests --runslow --durations=30 --constructors=pandas,pandas[nullable],pandas[pyarrow],pyarrow --cov-fail-under=50 diff --git a/.github/workflows/random_ci_pytest.yml b/.github/workflows/random_ci_pytest.yml index 2950989871..5c659d69a0 100644 --- a/.github/workflows/random_ci_pytest.yml +++ b/.github/workflows/random_ci_pytest.yml @@ -32,9 +32,11 @@ jobs: run: uv pip install -r random-requirements.txt --system - name: install-narwhals run: uv pip install -e . --group tests --system + - name: install-narwhals-testing + run: uv pip install -e narwhals-testing/. - name: show versions run: uv pip freeze - name: Run pytest run: | - pytest tests --cov=narwhals --cov=tests --cov-fail-under=75 \ + pytest --cov=narwhals --cov=narwhals-testing/narwhals_testing/tests --cov-fail-under=75 \ --constructors=pandas,pyarrow,polars[eager],polars[lazy] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 544ff6e5a6..32fe832630 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ If you've got experience with open source contributions, the following instructi - `git remote add origin ` - `uv venv -p 3.12` - `. .venv/bin/activate` -- `uv pip install -U -e . --group local-dev -e test-plugin` +- `uv pip install -U -e . --group local-dev -e test-plugin -e narwhals-testing` - To run tests: `pytest` - To run all linting checks: `pre-commit run --all-files` - To run static typing checks: `make typing` @@ -124,7 +124,7 @@ If you want to run PySpark-related tests, you'll need to have Java installed. Re 4. Activate it. On Linux, this is `. .venv/bin/activate`, on Windows `.\.venv\Scripts\activate`. -2. Install Narwhals: `uv pip install -e . --group local-dev -e test-plugin`. This will include fast-ish core libraries and dev dependencies. +2. Install Narwhals: `uv pip install -e . --group local-dev -e test-plugin -e narwhals-testing`. This will include fast-ish core libraries and dev dependencies. If you also want to test other libraries like Dask , PySpark, and Modin, you can install them too with `uv pip install -e ".[dask, pyspark, modin]" --group local-dev`. diff --git a/narwhals-testing/narwhals_testing/__init__.py b/narwhals-testing/narwhals_testing/__init__.py new file mode 100644 index 0000000000..d586436a8a --- /dev/null +++ b/narwhals-testing/narwhals_testing/__init__.py @@ -0,0 +1,18 @@ +"""narwhals-testing: Narwhals test suite distribution for plugin authors. + +Usage:: + + pip install narwhals-testing my-narwhals-plugin + pytest --pyargs narwhals_testing.tests --use-external-constructor +""" + +from __future__ import annotations + +from pathlib import Path + +__version__ = "0.1.0" + + +def get_test_dir() -> Path: + """Return the path to the distributed tests directory.""" + return Path(__file__).resolve().parent / "tests" diff --git a/narwhals-testing/narwhals_testing/_plugin.py b/narwhals-testing/narwhals_testing/_plugin.py new file mode 100644 index 0000000000..044e821f64 --- /dev/null +++ b/narwhals-testing/narwhals_testing/_plugin.py @@ -0,0 +1,48 @@ +"""narwhals-testing pytest plugin. + +Registered via the ``pytest11`` entry point. Handles two concerns: + +1. Adds the ``narwhals_testing`` package directory to ``sys.path`` so that + distributed test files can resolve ``from tests.utils import ...``. + This happens at import time because entry-point plugin modules are + imported before conftest files are loaded. + +2. Registers CLI options (``--use-external-constructor``, etc.) so they are + available even when tests are run via ``--pyargs``. +""" + +from __future__ import annotations + +import sys +from pathlib import Path +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + import pytest + +_PACKAGE_DIR = str(Path(__file__).resolve().parent) + +if _PACKAGE_DIR not in sys.path: + sys.path.insert(0, _PACKAGE_DIR) + + +def pytest_addoption(parser: pytest.Parser) -> None: + group = parser.getgroup("narwhals-testing") + group.addoption( + "--runslow", action="store_true", default=False, help="run slow tests" + ) + group.addoption( + "--all-cpu-constructors", + action="store_true", + default=False, + help="run tests with all cpu constructors", + ) + group.addoption( + "--use-external-constructor", + action="store_true", + default=False, + help="run tests with external constructor", + ) + group.addoption( + "--constructors", action="store", default=None, type=str, help="libraries to test" + ) diff --git a/tests/__init__.py b/narwhals-testing/narwhals_testing/py.typed similarity index 100% rename from tests/__init__.py rename to narwhals-testing/narwhals_testing/py.typed diff --git a/tests/dependencies/__init__.py b/narwhals-testing/narwhals_testing/tests/__init__.py similarity index 100% rename from tests/dependencies/__init__.py rename to narwhals-testing/narwhals_testing/tests/__init__.py diff --git a/tests/conftest.py b/narwhals-testing/narwhals_testing/tests/conftest.py similarity index 93% rename from tests/conftest.py rename to narwhals-testing/narwhals_testing/tests/conftest.py index 3e80bcdff4..63b12ceec4 100644 --- a/tests/conftest.py +++ b/narwhals-testing/narwhals_testing/tests/conftest.py @@ -8,10 +8,10 @@ from typing import TYPE_CHECKING, Any, Callable, cast import pytest +from tests.utils import ID_PANDAS_LIKE, PANDAS_VERSION, pyspark_session, sqlframe_session import narwhals as nw from narwhals._utils import Implementation, generate_temporary_column_name -from tests.utils import ID_PANDAS_LIKE, PANDAS_VERSION, pyspark_session, sqlframe_session if TYPE_CHECKING: from collections.abc import Sequence @@ -21,17 +21,17 @@ import polars as pl import pyarrow as pa from ibis.backends.duckdb import Backend as IbisDuckDBBackend - from typing_extensions import TypeAlias - - from narwhals._native import NativeDask, NativeDuckDB, NativePySpark, NativeSQLFrame - from narwhals._typing import EagerAllowed - from narwhals.typing import IntoDataFrame, NonNestedDType from tests.utils import ( Constructor, ConstructorEager, ConstructorLazy, NestedOrEnumDType, ) + from typing_extensions import TypeAlias + + from narwhals._native import NativeDask, NativeDuckDB, NativePySpark, NativeSQLFrame + from narwhals._typing import EagerAllowed + from narwhals.typing import IntoDataFrame, NonNestedDType Data: TypeAlias = "dict[str, list[Any]]" @@ -52,31 +52,6 @@ ) -def pytest_addoption(parser: pytest.Parser) -> None: - parser.addoption( - "--runslow", action="store_true", default=False, help="run slow tests" - ) - parser.addoption( - "--all-cpu-constructors", - action="store_true", - default=False, - help="run tests with all cpu constructors", - ) - parser.addoption( - "--use-external-constructor", - action="store_true", - default=False, - help="run tests with external constructor", - ) - parser.addoption( - "--constructors", - action="store", - default=DEFAULT_CONSTRUCTORS, - type=str, - help="libraries to test", - ) - - def pytest_configure(config: pytest.Config) -> None: config.addinivalue_line("markers", "slow: mark test as slow to run") @@ -274,8 +249,12 @@ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None: } ] else: # pragma: no cover - opt = cast("str", metafunc.config.getoption("constructors")) - selected_constructors = opt.split(",") + opt = metafunc.config.getoption("constructors") + selected_constructors = ( + cast("str", opt).split(",") + if opt is not None + else DEFAULT_CONSTRUCTORS.split(",") + ) eager_constructors: list[ConstructorEager] = [] eager_constructors_ids: list[str] = [] diff --git a/tests/data/customer.csv b/narwhals-testing/narwhals_testing/tests/data/customer.csv similarity index 96% rename from tests/data/customer.csv rename to narwhals-testing/narwhals_testing/tests/data/customer.csv index 95ba9783e0..c15dbb8694 100644 --- a/tests/data/customer.csv +++ b/narwhals-testing/narwhals_testing/tests/data/customer.csv @@ -14,20 +14,20 @@ c_custkey,c_name,c_address,c_nationkey,c_phone,c_acctbal,c_mktsegment,c_comment 54646,Customer#000054646,7GW8nKFRJFjP,16,26-167-726-6661,3937.68,HOUSEHOLD, slow escapades. final foxes are. carefully final instructions are carefully above the sl 29707,Customer#000029707,l7G2SJcj8vU3NEXbFtp0xKIWu 2qEjzCpQu,4,14-688-605-3109,8574.87,MACHINERY,. ironic deposits about the slyly regular instructions boost quickly bold notornis. pending foxe 71920,Customer#000071920,3ZqbQWNtnaxXEhoeOlu4IFYJWZ9,19,29-542-535-5422,3637.22,HOUSEHOLD,y quick platelets run enticingly. foxes are carefully even packages. furi -12464,Customer#000012464,"nHVB3Jmp,wIdurDGVzr6p,4QKnw Mr,",16,26-741-623-4200,2242.57,BUILDING,ravely before the carefully regular deposits. quickly special packages i +12464,Customer#000012464,"nHVB3Jmp,wIdurDGVzr6p,4QKnow Mr,",16,26-741-623-4200,2242.57,BUILDING,ravely before the carefully regular deposits. quickly special packages i 144944,Customer#000144944,"Exp7LHTi0C8ZCvZpFKUyQiBjFpRtI0,zTUz",3,13-764-927-3567,2386.72,BUILDING,sly ironic requests doze along the dependencies. furiously unusual packages nag: furiously regular packages sleep c 48725,Customer#000048725,"SdkMKx85P,2l1L51cVH5jBE k5QaD v2",23,33-461-569-1667,1182.6,MACHINERY,riously even pinto beans snooze blithely acro 38621,Customer#000038621,"BiMUUgOd,Mjlf1gKk xQLO4a2Z9PPzA5EH2o0V",4,14-870-685-4174,1575.55,MACHINERY,s. blithely regular deposits integ 21211,Customer#000021211,"DoP5K,gL,w",7,17-696-357-4107,8154.11,MACHINERY,ar deposits are foxes. pinto beans ac 100712,Customer#000100712,"2w,RLthRtU czndFwVrzB1pyS6",5,15-432-381-9137,2816.25,AUTOMOBILE,- carefully even foxes wake carefully final ideas. carefully unu 131531,Customer#000131531,"1HMpjJAw7mq0i,dy8EhAvD29XAz",11,21-109-714-9031,3037.89,HOUSEHOLD,final courts nag furiously blithely regular tithes. furiously -119049,Customer#000119049,mFnk2aXLhOif7bZQ22qon,6,16-218-969-3590,5047.71,FURNITURE," final dependencies use quickly. furiously ironic packages are blithe, final requests. ironic depos" -134091,Customer#000134091,wMeHMsLFrmoVoUWPNdYr2KrMDbdv,15,25-274-630-1963,8633.34,BUILDING,ldly ironic instructions sleep among t +119049,Customer#000119049,mFnk2aXLhOf7bZQ22qon,6,16-218-969-3590,5047.71,FURNITURE," final dependencies use quickly. furiously ironic packages are blithe, final requests. ironic depos" +134091,Customer#000134091,wMeHMsLFromVoUWPNdYr2KrMDbdv,15,25-274-630-1963,8633.34,BUILDING,ldly ironic instructions sleep among t 132913,Customer#000132913,eNgnGOmSTE115hkcneXg4OGvSih,5,15-424-213-9645,578.63,MACHINERY,instructions doubt quickly according to 96529,Customer#000096529,b1SDpBCn8UG yN41yclPhzXdFhvkoP8o,13,23-325-285-9095,8585.16,AUTOMOBILE,"en theodolites sleep furiously silent asymptotes. regular, even deposits do cajole quickly unusual foxes. careful" 111585,Customer#000111585,VhGgZopKldjcOh8zyyqVugy fyplw3VRzjwCW,1,11-925-410-4988,5912.99,BUILDING,lithely bold ideas. regular epitaphs should have to doubt slyly. st 143149,Customer#000143149,S chMUfCYqmX0eFlfFp6,21,31-129-780-6224,4532.68,FURNITURE,requests. even packages play along -13923,Customer#000013923,WtHYX1JCDIyEDm,4,14-782-399-4214,4465.41,BUILDING,"ake fluffily? unusual, final accounts haggle. blithely regu" +13923,Customer#000013923,WtHYX1JCDIyEDm,4,14-782-399-4214,4465.41,BUILDING,"ache fluffily? unusual, final accounts haggle. blithely regu" 128712,Customer#000128712,PtDFcZvKDfa,15,25-809-374-7239,654.39,HOUSEHOLD,cording to the furiously final requests. daring accounts detec 83620,Customer#000083620,"7 DkPVoBDm5ppU,8OaWU1",3,13-393-710-4173,1128.93,MACHINERY, across the furiously pending instructions cajole slyly according to the blithely special ins 141807,Customer#000141807,a4iONC95dUrpy3qdV4ZmmujW7ZR7SBwzQLlto00,19,29-821-613-7161,55.87,MACHINERY,n accounts use carefully final accounts. blithely unusual packages according to the pinto beans sle @@ -57,16 +57,16 @@ c_custkey,c_name,c_address,c_nationkey,c_phone,c_acctbal,c_mktsegment,c_comment 88692,Customer#000088692,HAz7nzT0j1,2,12-701-138-5803,5472.1,MACHINERY, ironic foxes. even packages cajole slyly. fluffily pending packages na 41356,Customer#000041356,"3b8Aj,Dd5WVP91mxoAW8rk9mnEMkETwYWeH",23,33-884-373-9171,1666.61,FURNITURE,s. quickly final foxes wake according to the fluffily spec 91542,Customer#000091542,"TPtDGESELfkgj3NTqyQ0QE,x",21,31-995-284-2946,8331.34,BUILDING,s wake pending deposits. final packages should impress furiously special dolphins. slyly regular instructi -98869,Customer#000098869,"BqW dkg7Ks9Kdqo mndc,wBK9okwGOEk8PAS",21,31-979-520-5658,5409.67,AUTOMOBILE,uests. carefully bold deposits use. slyly silent accounts nag along the blithely ironic dolphins. +98869,Customer#000098869,"BqW dkg7Ks9Kdqo mndc,wBK9okwGOEk8PAS",21,31-979-520-5658,5409.67,AUTOMOBILE,quests. carefully bold deposits use. slyly silent accounts nag along the blithely ironic dolphins. 15177,Customer#000015177,umfI8sQnqwShlE,10,20-158-453-4685,1528.72,HOUSEHOLD,lar dependencies lose across t 132686,Customer#000132686,vILbzoOW AJLMk60dMn,8,18-349-923-4811,7456.83,BUILDING,ets around the slyly even platelets are along 7611,Customer#000007611,n88RbCGdhOgWVvI64vGplTHFFDI,16,26-364-837-8425,8045.97,FURNITURE,r the quickly pending packages. sometimes blithe p -95139,Customer#000095139,yhn3qaIYkEcQwo06zKlA,8,18-195-333-5833,6757.24,BUILDING,sly pending requests sleep carefully. final asymptotes are carefully blithely final accoun +95139,Customer#000095139,yhn3qaIYkEcQwo06zKlA,8,18-195-333-5833,6757.24,BUILDING,sly pending requests sleep carefully. final asymptotes are carefully blithely final account 106226,Customer#000106226,",dA03 xWId5hGFoEFi8KZo,tFdsUMEXNwzJ",17,27-144-346-1222,1938.28,AUTOMOBILE,"onic, ironic deposits. quickly ironic accounts affix finally acc" 110342,Customer#000110342,bhBqIb0GSzBlYYLCiORuo2vn9,7,17-744-972-3784,9530.96,AUTOMOBILE,ffily even platelets nag according to the final requests. quickly spec 74858,Customer#000074858,jM3BEV98D9pQzQ8FdslEHD9 YrXvuw5pQmEU4,2,12-443-515-5250,4419.21,MACHINERY,furiously furiously unusual requests. unusual courts are fluffi 93541,Customer#000093541,cBX1P34igGTbDS0Vw6qg01H RYmXys2GNosLn5zN,10,20-226-446-9932,2749.04,FURNITURE,nic packages. ironic theodolites would are. carefully daring deposits boost carefully fluffily bold dugou -107929,Customer#000107929,gl jtSo9FYklz7769Pf,0,10-864-256-4227,8310.01,MACHINERY,uests doze quickly along the ideas. blithely ironic dependencies wake furiously. blithely p +107929,Customer#000107929,gl jtSo9FYklz7769Pf,0,10-864-256-4227,8310.01,MACHINERY,quests doze quickly along the ideas. blithely ironic dependencies wake furiously. blithely p 123404,Customer#000123404,Mlu7C77CLrdTXJV,12,22-355-388-8411,8252.97,AUTOMOBILE,s detect after the ironic dolphins. furiously express deposits wake furiously. slyly bold accounts use quick 62776,Customer#000062776,KfpixW3PzAkbQXvKNJLvO,15,25-286-133-2682,9803.59,BUILDING,"ross the furiously ironic deposits. regular, pending instructions haggle? pendin" 87795,Customer#000087795,IKQkaBC2JBUZJM4QS7Ew 5pifBj6VBi,4,14-766-442-8674,-709.18,BUILDING,posits are carefully blithely ironic ideas. @@ -93,7 +93,7 @@ c_custkey,c_name,c_address,c_nationkey,c_phone,c_acctbal,c_mktsegment,c_comment 10468,Customer#000010468,dVh9nqrcZ56lMMf1WqhnFR2QvUgw0zzLP,20,30-391-542-5713,7595.57,BUILDING,"y unusual, bold theodolites. fu" 47788,Customer#000047788,Gd eRL968G2,17,27-816-600-2010,2914.87,FURNITURE,"s x-ray finally. blithely regular accounts sleep carefully furiously unusual packages-- pending, ex" 109417,Customer#000109417,"jKNBKzbBmPK,z4q85S8 12 T",6,16-542-992-7452,509.4,FURNITURE,sly regular excuses. sometimes ironic theodolites haggle fur -140783,Customer#000140783,"ezh31,RUQ2xzoIpaCpbtYJVNsfg1u,Foir k8a",23,33-898-698-5283,1918.38,AUTOMOBILE, slyly regular ideas. carefully special packages nag fluffily final packages. furiously even asymptote +140783,Customer#000140783,"ezh31,RUQ2xzoIpaCpbtYJVNsfg1u,For k8a",23,33-898-698-5283,1918.38,AUTOMOBILE, slyly regular ideas. carefully special packages nag fluffily final packages. furiously even asymptote 88971,Customer#000088971,gCRRVOm10rMAc y5MkBf3T npSfWkZHS5jEyo Fk,16,26-326-933-3055,7651.56,AUTOMOBILE,"s sleep carefully above the regular, silent" 80739,Customer#000080739,"GeA01h0LL,bOnerz50crqAOFHv",21,31-712-173-3243,8105.31,AUTOMOBILE,equests. slyly fluffy packages sleep carefully final packages. slyly bold theodolites cajole a 46279,Customer#000046279,HTd2sDC caBh GzG9NfIkbcWRJGM,16,26-909-613-7776,966.01,AUTOMOBILE,above the fluffily quiet platelets! carefully regular accounts wake carefully instructions. careful @@ -109,14 +109,14 @@ c_custkey,c_name,c_address,c_nationkey,c_phone,c_acctbal,c_mktsegment,c_comment 115923,Customer#000115923,"Xjm4zwUe,am",21,31-501-485-5374,8277.27,MACHINERY, accounts. even platelets along the furiously unusual packages wake after the slyly bold account 140247,Customer#000140247,"eckkCw4o28,,5",20,30-630-772-8286,-297.25,BUILDING,l ideas use quickly packages. b 49299,Customer#000049299,"4b2BbevC4MdVTtOwlZbJ D3vasrhOxIu,Avy,q",9,19-477-670-3711,7327.74,AUTOMOBILE,? ideas doze. quickly ironic co -95640,Customer#000095640,",Nw2lzEIN6 SWMKYLYwyiI5XZ6jTZlLUu",5,15-756-635-6570,5480.61,MACHINERY,ar requests! special ideas against the carefully final accounts dazzle after the s +95640,Customer#000095640,",Nw2lzIN6 SWMKYLYwyiI5XZ6jTZlLUu",5,15-756-635-6570,5480.61,MACHINERY,ar requests! special ideas against the carefully final accounts dazzle after the s 49831,Customer#000049831, aFhnHzXnu8R0wyFQ6Z4NNPQhog6WdcGRCqWi87o,22,32-282-161-3763,4501.08,AUTOMOBILE,requests wake among the final requests. fluffily even pinto beans are ca 45786,Customer#000045786,QPO8gpGRxU G0uE1gM48b,5,15-719-547-7831,220.54,HOUSEHOLD,"y final, pending deposits! ruthlessly express excuses sleep. final" 114663,Customer#000114663,T5hp2lYvnUO,2,12-771-653-4436,-233.91,HOUSEHOLD, the theodolites. furiously unusual pinto beans cajole furio 71094,Customer#000071094,DBSbdJL2SC7lbRC1Olp4Dk8Gq6bx,15,25-379-892-9141,8958.15,FURNITURE, bold theodolites wake careful 91342,Customer#000091342,xCLQWb9tNyoNm3Ldv8l1YkXCkv,16,26-144-484-7765,4923.36,AUTOMOBILE,ar deposits about the quietly regular gifts sleep blithely ironic deposits. quickly speci 87667,Customer#000087667,"pPer4kqwgbihuKrT6dRfX,aHzNJtX",21,31-674-780-1253,4407.38,FURNITURE,ng the slyly special orbits. blithely special theodolites sleep thinly s -93387,Customer#000093387,UjQlhj1WyX6 lURikWdbZpb,1,11-659-151-1178,3135.72,HOUSEHOLD,packages use furiously after the carefully regular accoun +93387,Customer#000093387,UjQlhj1WyX6 lURikWdbZpb,1,11-659-151-1178,3135.72,HOUSEHOLD,packages use furiously after the carefully regular account 88199,Customer#000088199,78qgEdZaYjaPnc,16,26-174-251-5705,8069.31,AUTOMOBILE,ts use quickly above the unusual requests. furiously final instructions solve according to the quickly regula 86652,Customer#000086652,F 3mCkyg4hclziQXNkX,21,31-111-844-4398,-356.23,HOUSEHOLD,ngside of the blithely unusual pinto beans. carefully regular accounts shall have to are blithely. 146839,Customer#000146839,",2RG3gUbZJ7",8,18-782-823-4995,5210.71,BUILDING,s according to the requests haggle thinly @@ -149,7 +149,7 @@ c_custkey,c_name,c_address,c_nationkey,c_phone,c_acctbal,c_mktsegment,c_comment 130612,Customer#000130612,KtRmJ34ZTNfoqNeuEiIohWaXt5Jkp 1,0,10-821-145-2969,7983.18,BUILDING,he ironic accounts. even foxes nag 118801,Customer#000118801,xGAAy4J7aYVpjMHcFUu7Z7T,11,21-106-282-7679,8695.35,HOUSEHOLD,ts sleep fluffily after the furiously 128270,Customer#000128270,0WdRH0p22ijSQ,6,16-614-638-2766,1486.53,AUTOMOBILE,"st slyly unusual instructions. regular, pending packages use furiously. dep" -80209,Customer#000080209,5B2cTDxxYx3l6Kz9g2,9,19-564-998-2960,6834.27,FURNITURE,"ake slyly among the bold accounts. stealthy, even foxes use slyly regular, pending asymptotes. bold, ironic" +80209,Customer#000080209,5B2cTDxxYx3l6Kz9g2,9,19-564-998-2960,6834.27,FURNITURE,"ache slyly among the bold accounts. stealthy, even foxes use slyly regular, pending asymptotes. bold, ironic" 146409,Customer#000146409,oUHZ7jxh0zpc0UswPRxYKYm363eJ3sH,0,10-650-353-7408,2627.89,HOUSEHOLD,s dolphins are. quickly ironic accounts cajole slyly ruthless packages! even foxes was quickly theodolites. 52914,Customer#000052914,"ytvFJtG5Hok,m7yuBfBVOb3bhC hMHCpBY,,",19,29-282-763-7464,63.63,HOUSEHOLD," the blithely regular theodolites. regular, express pl" 27520,Customer#000027520,"19nAYgC4wuDsyrT90dO7NeyrnQvqV,Jt",5,15-866-403-3155,1257.06,BUILDING,n dependencies can wake ironic accounts. fluf @@ -164,9 +164,9 @@ c_custkey,c_name,c_address,c_nationkey,c_phone,c_acctbal,c_mktsegment,c_comment 79058,Customer#000079058,"Yanq4xA,VBhgogeBYnhKs",3,13-275-643-2854,217.18,BUILDING, express sauternes. furiously final accounts sleep fluffily. blithely re 66769,Customer#000066769,L4CTCoJjt31,1,11-639-238-5104,9494.5,HOUSEHOLD,cial excuses. carefully pending requests alongside of the quickly pending pinto bean 32852,Customer#000032852,"aECQzWdHYl0JXBWB,njMj",22,32-251-853-8084,9623.6,FURNITURE,usly pending deposits. bold asymptotes affix- -26356,Customer#000026356,inDRafeVxg3CL0UNUvtRwH2A,11,21-134-424-4899,6701.34,MACHINERY,thely final pinto beans. furiously unusual ideas use carefully evenly expres +26356,Customer#000026356,inDRafeVxg3CL0UNUvtRwH2A,11,21-134-424-4899,6701.34,MACHINERY,thely final pinto beans. furiously unusual ideas use carefully evenly express 73337,Customer#000073337,"9m9fxZsovgV2yexPkHeKA4fqWraYGB8b,axW",7,17-472-754-2280,2381.62,HOUSEHOLD,ogged foxes. final dependencies wake quickly across the express packages. pending grouches engage ac -41405,Customer#000041405,"gHOnlB9F7v0qZdkuvu,xk8tw paQ17EUWKMmCx",0,10-502-638-2755,1362.8,BUILDING,"ounts integrate special, regular excuses. blithely special pearls sleep furiously. slyly pending d" +41405,Customer#000041405,"gHOnlyB9F7v0qZdkuvu,xk8tw paQ17EUWKMmCx",0,10-502-638-2755,1362.8,BUILDING,"ounts integrate special, regular excuses. blithely special pearls sleep furiously. slyly pending d" 61895,Customer#000061895,VX0IbFZXkqBYFpPZPox1U8Z,21,31-315-719-9868,358.33,MACHINERY,"posits haggle slyly. packages are express, special accounts. instructions wake fluffily packages: pinto beans are q" 96040,Customer#000096040,"2zggbjUvEqzB2S7L4rc7kGZpfNLwqK3,IhrN 8",3,13-758-328-4612,2979.98,AUTOMOBILE, at the slow requests affix about the carefully permanent asymptotes. slyly pending foxes sleep blithely. furio 92210,Customer#000092210,8VqWru7pnh,11,21-749-837-2912,4159.91,FURNITURE,quests. bold accounts sleep furiously. pending requests wake slyly. reg @@ -175,10 +175,10 @@ c_custkey,c_name,c_address,c_nationkey,c_phone,c_acctbal,c_mktsegment,c_comment 41658,Customer#000041658,DDJbKb1L3Mmk,11,21-290-666-2406,5798.09,BUILDING,dugouts sleep slyly. blithely ironic deposits haggle quickly. bold excuses against the regular 59943,Customer#000059943,xkzNRxmypl0w7cABKC5hxa68,3,13-127-423-3354,5574.91,FURNITURE,"kages are fluffily along the slyly ironic requests: bold, p" 147738,Customer#000147738,UC84i6iBPWowrMM2DmJGe2JSpVybqS1vY,20,30-561-504-8639,3422.82,BUILDING,kages. carefully special excuses detect above the slyly ironic dep -81176,Customer#000081176,JDPKkUQOCqF5gvc,19,29-112-600-1744,5501.27,MACHINERY,ording to the slyly final instructions wake fluffily unusual +81176,Customer#000081176,JDPKkUQOCqF5gvc,19,29-112-600-1744,5501.27,MACHINERY,ordering to the slyly final instructions wake fluffily unusual 141983,Customer#000141983,"Rt,k7fyTBpZ8E8NXWQGW0",10,20-644-276-6079,4388.61,FURNITURE,usly express requests sleep slyly up the quickly dogged excuses. accounts against 51469,Customer#000051469,"RhekTsKMM6hOyYUhH6ZgualfA,rOZsRTVQL",18,28-710-275-1863,7953.19,AUTOMOBILE,deposits wake fluffily. slyly final pinto -4878,Customer#000004878, 459WA6Qid,12,22-128-333-9665,9044.94,FURNITURE,encies affix alongside of the slyly blithe pinto beans. furiously regular packag +4878,Customer#000004878, 459WA6Qid,12,22-128-333-9665,9044.94,FURNITURE,encies affix alongside of the slyly blithe pinto beans. furiously regular package 139041,Customer#000139041,SrXj4nhTzh2jneAU1a8vBvS1npzakGpm,14,24-491-190-6124,4539.71,MACHINERY,"even ideas. pending, final dinos at " 64233,Customer#000064233,UDBH7QzZmiYoO6gxv,6,16-519-872-9312,7365.48,BUILDING,ffily special foxes cajole aft 139329,Customer#000139329,"iYUzOLGd9qT,sDEQzdnZzR,E1J d,W6CC5le7",15,25-338-619-9280,6953.67,MACHINERY, foxes within the final ideas solve furiously blithely express foxes. theodolites wake furiously. slyly final depos @@ -233,8 +233,8 @@ c_custkey,c_name,c_address,c_nationkey,c_phone,c_acctbal,c_mktsegment,c_comment 37556,Customer#000037556,RHbhsUiJn F4BZ,18,28-830-676-3897,5670.27,FURNITURE,ses? furiously silent packages boost quickly 132828,Customer#000132828,OF3rdCiswX,15,25-529-718-2058,1619.4,FURNITURE,ding requests. furiously fluffy requests boost blithely 52378,Customer#000052378,xq58AAvU5J7clYeYwv7c2c7A3 DD27okPX45Tkf,24,34-678-776-5667,5095.94,MACHINERY,s thrash furiously. packages haggle across the quickly daring pinto beans. regular dependencies boost slyly never si -112166,Customer#000112166,"23xkUPS NVjMZLS,B5PvFG1IC3PLkx",22,32-637-111-5519,8926.26,FURNITURE,ithely bold accounts. furiously express deposits integrate abov -37378,Customer#000037378,uF0zUmyi3p,15,25-514-346-9137,5959.43,AUTOMOBILE, even pinto beans sleep quickly whithout the carefully regular instructions. quickly regular +112166,Customer#000112166,"23xkUPS NVjMZLS,B5PvFG1IC3PLkx",22,32-637-111-5519,8926.26,FURNITURE,ithely bold accounts. furiously express deposits integrate above +37378,Customer#000037378,uF0zUmyi3p,15,25-514-346-9137,5959.43,AUTOMOBILE, even pinto beans sleep quickly without the carefully regular instructions. quickly regular 147869,Customer#000147869,Ad8VilmB2vNCP zt4XRqMiR,10,20-895-893-3642,3250.22,HOUSEHOLD, beans boost blithely pending ideas. furiously special accounts was at th 127353,Customer#000127353,P9GIGGjxvCeiR,17,27-826-607-2514,8521.73,HOUSEHOLD," the slyly express asymptotes boost unusual, regular pinto beans. furiously regular instructions " 109564,Customer#000109564,WgcWnlFNhUCEdfK,8,18-563-905-3068,-81.14,FURNITURE,have to use fluffily express requests. unusual packages are slyly. quickly sp @@ -277,7 +277,7 @@ c_custkey,c_name,c_address,c_nationkey,c_phone,c_acctbal,c_mktsegment,c_comment 79228,Customer#000079228,t8sqsYMLhzRlhxdXR1hsR35,8,18-536-464-3784,6648.52,MACHINERY,inal ideas x-ray slyly ironic accounts. 67245,Customer#000067245,"Fr aR1AuAh,gd19cBE2s9mJ",15,25-367-209-7084,5559.09,HOUSEHOLD,according to the furiously ironic instructions. quickly regular platel 143166,Customer#000143166,"2VbF,8ETsvpPTuqSa9rAB165WnreMRoAP3UH",21,31-107-836-7321,7056.61,FURNITURE,ly final warthogs. furiously even theodolites ca -104516,Customer#000104516,"Ve9uDoPFa4bjwNd,9b0adnIMOt4",7,17-164-730-7794,4796.67,HOUSEHOLD,"nic attainments sleep slyly ironic, iro" +104516,Customer#000104516,"Ve9uDoPFa4bjwNd,9b0andIMOt4",7,17-164-730-7794,4796.67,HOUSEHOLD,"nic attainments sleep slyly ironic, iro" 99152,Customer#000099152,eVNB3WUm31qV6Po3Tm3s,22,32-974-121-3575,827.14,HOUSEHOLD,s dolphins wake furiously unus 125793,Customer#000125793,"HrwNb,n7zXVwKA",8,18-846-242-3558,9682.99,AUTOMOBILE,uctions haggle slyly carefully bold deposits. slowly regular deposits detect fluffily. blithely i 19957,Customer#000019957,rw3EMBWVnkgAVPlQXe4WuW9Nke,0,10-659-117-4364,7684.26,AUTOMOBILE,"carefully after the even ideas. pending, regular accounts haggle furiously. blithely bold accounts wa" diff --git a/tests/data/lineitem.csv b/narwhals-testing/narwhals_testing/tests/data/lineitem.csv similarity index 98% rename from tests/data/lineitem.csv rename to narwhals-testing/narwhals_testing/tests/data/lineitem.csv index 727e3bb227..ad94bde8fc 100644 --- a/tests/data/lineitem.csv +++ b/narwhals-testing/narwhals_testing/tests/data/lineitem.csv @@ -6,7 +6,7 @@ l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discoun 3880769,95050,2578,3,13.0,13585.65,0.1,0.08,A,F,1994-01-08,1993-12-01,1994-01-11,TAKE BACK RETURN,MAIL, requests wake alongside of the q 144096,122264,9801,5,47.0,60454.22,0.08,0.05,N,O,1997-05-22,1997-05-23,1997-06-05,TAKE BACK RETURN,SHIP, express deposits 2839591,173172,724,4,5.0,6225.85,0.1,0.07,N,O,1997-07-31,1997-07-24,1997-08-15,DELIVER IN PERSON,REG AIR,gular foxes. ironic packa -1115783,71283,6298,2,43.0,53934.04,0.07,0.02,A,F,1994-08-10,1994-08-19,1994-08-18,DELIVER IN PERSON,MAIL,ss ideas affix fluffily slyly even accoun +1115783,71283,6298,2,43.0,53934.04,0.07,0.02,A,F,1994-08-10,1994-08-19,1994-08-18,DELIVER IN PERSON,MAIL,ss ideas affix fluffily slyly even account 2086402,112493,27,3,11.0,16560.39,0.06,0.08,N,O,1996-04-26,1996-06-20,1996-05-08,DELIVER IN PERSON,SHIP,ut the even deposits. furiously special th 2830784,196193,1232,4,12.0,15470.28,0.1,0.05,R,F,1993-11-16,1993-12-03,1993-11-24,DELIVER IN PERSON,SHIP,e dugouts. slyly unu 1717702,67152,2165,5,1.0,1119.15,0.01,0.07,A,F,1994-07-26,1994-07-27,1994-07-27,DELIVER IN PERSON,RAIL,kly express ide @@ -55,7 +55,7 @@ l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discoun 3118310,11375,3877,4,1.0,1286.37,0.05,0.0,N,O,1997-11-24,1998-01-08,1997-12-19,DELIVER IN PERSON,MAIL,olphins haggle quickly after the quick 5517666,56913,1924,5,30.0,56097.3,0.08,0.03,R,F,1992-07-22,1992-05-14,1992-07-24,NONE,FOB, packages. slyl 2707683,189851,2370,5,33.0,64048.05,0.08,0.0,N,O,1998-02-19,1998-01-06,1998-03-16,DELIVER IN PERSON,AIR,among the blithely -5414914,120959,3472,1,42.0,83157.9,0.0,0.01,R,F,1994-07-18,1994-07-11,1994-08-08,DELIVER IN PERSON,RAIL,ake slyly above the carefully ir +5414914,120959,3472,1,42.0,83157.9,0.0,0.01,R,F,1994-07-18,1994-07-11,1994-08-08,DELIVER IN PERSON,RAIL,ache slyly above the carefully ir 1825028,48536,8537,2,50.0,74226.5,0.1,0.03,N,O,1998-08-05,1998-06-26,1998-08-06,COLLECT COD,TRUCK, attainments cajole blith 4148518,66219,3738,2,26.0,30815.46,0.04,0.06,N,O,1995-11-04,1995-12-07,1995-11-28,DELIVER IN PERSON,TRUCK, regular courts. carefully un 4565510,120429,5454,5,33.0,47830.86,0.01,0.06,N,O,1996-06-05,1996-04-15,1996-06-28,COLLECT COD,MAIL,kly regula @@ -115,11 +115,11 @@ l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discoun 1282019,123924,3925,1,16.0,31166.72,0.05,0.0,N,O,1998-01-07,1998-01-04,1998-01-28,COLLECT COD,TRUCK,d requests. accounts are carefully fin 5567940,109654,7185,3,9.0,14972.85,0.03,0.03,N,O,1998-06-25,1998-07-25,1998-07-07,DELIVER IN PERSON,MAIL, are slyly. unus 1001349,39325,4332,3,27.0,34136.64,0.03,0.0,N,O,1998-01-21,1997-12-06,1998-02-12,DELIVER IN PERSON,TRUCK,arefully blithely -1834278,91358,6377,5,48.0,64768.8,0.01,0.01,A,F,1994-05-03,1994-06-04,1994-05-12,TAKE BACK RETURN,RAIL,sts maintain quickly about the som +1834278,91358,6377,5,48.0,64768.8,0.01,0.01,A,F,1994-05-03,1994-06-04,1994-05-12,TAKE BACK RETURN,RAIL,sts maintain quickly about the some 24002,13640,6142,3,43.0,66806.52,0.03,0.07,N,O,1997-02-13,1997-01-17,1997-03-14,DELIVER IN PERSON,SHIP,ular excuses are slyly outside the slyly 1706406,74734,7242,5,49.0,83727.77,0.08,0.01,N,O,1996-06-04,1996-05-01,1996-07-02,NONE,AIR," ironic packages! even, final " 538180,143292,835,4,1.0,1335.29,0.0,0.08,A,F,1992-08-27,1992-09-01,1992-09-17,DELIVER IN PERSON,FOB,"y carefully regular platelets. regular, " -92928,151956,6987,3,15.0,30119.25,0.06,0.07,A,F,1992-08-22,1992-08-26,1992-09-16,DELIVER IN PERSON,FOB, solve furiously. slyly expres +92928,151956,6987,3,15.0,30119.25,0.06,0.07,A,F,1992-08-22,1992-08-26,1992-09-16,DELIVER IN PERSON,FOB, solve furiously. slyly express 3867685,85202,219,5,11.0,13059.2,0.09,0.05,R,F,1993-11-30,1993-12-18,1993-12-22,TAKE BACK RETURN,REG AIR,"efully. regular, express platelets ca" 4609829,53394,910,1,9.0,12126.51,0.0,0.02,N,O,1996-05-10,1996-03-24,1996-06-05,TAKE BACK RETURN,FOB,ven ideas. 2787043,124553,7066,1,23.0,36283.65,0.05,0.03,N,O,1997-08-18,1997-07-07,1997-09-11,TAKE BACK RETURN,RAIL,ss theodolites are slyly @@ -140,7 +140,7 @@ l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discoun 2855076,136138,1165,5,34.0,39920.42,0.04,0.03,N,O,1998-04-16,1998-03-09,1998-04-20,DELIVER IN PERSON,TRUCK,ages sleep. requests wake fluffily bold ide 1255396,129699,7236,1,12.0,20744.28,0.09,0.05,N,O,1995-06-26,1995-06-20,1995-07-11,DELIVER IN PERSON,AIR,thely regular ideas. express accounts 2182471,81834,1835,2,35.0,63554.05,0.03,0.05,N,O,1995-10-19,1995-11-21,1995-11-10,TAKE BACK RETURN,REG AIR,en foxes are final packages. -1487622,161709,4226,1,6.0,10624.2,0.09,0.0,R,F,1992-07-25,1992-08-08,1992-08-19,NONE,FOB,nto beans are b +1487622,161709,4226,1,6.0,10624.2,0.09,0.0,R,F,1992-07-25,1992-08-08,1992-08-19,NONE,FOB,not beans are b 1065602,188750,1269,2,20.0,36775.0,0.07,0.04,N,O,1998-05-22,1998-05-27,1998-05-26,DELIVER IN PERSON,TRUCK,usual deposits-- carefully even foxes 2216998,125213,2750,3,49.0,60672.29,0.09,0.05,N,O,1998-09-30,1998-08-16,1998-10-22,DELIVER IN PERSON,SHIP,ly even packages hang blithely pendi 5401088,104130,6641,4,23.0,26084.99,0.07,0.03,R,F,1993-04-13,1993-03-16,1993-04-22,COLLECT COD,MAIL,"he even, express accounts cajole slyly b" @@ -160,7 +160,7 @@ l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discoun 4827425,148760,1275,3,24.0,43410.24,0.01,0.05,R,F,1993-07-21,1993-09-27,1993-08-15,DELIVER IN PERSON,RAIL,cording to the regular accounts. spec 323398,67731,2744,2,26.0,44166.98,0.09,0.06,A,F,1993-09-22,1993-09-01,1993-10-12,NONE,MAIL, carefully carefully special foxes. ironic 1648897,93816,6326,2,49.0,88680.69,0.04,0.06,R,F,1992-09-10,1992-09-02,1992-09-26,TAKE BACK RETURN,TRUCK,requests. blithely r -46023,146600,9115,3,11.0,18112.6,0.04,0.06,A,F,1992-05-27,1992-06-17,1992-06-16,TAKE BACK RETURN,AIR,ect quickly caref +46023,146600,9115,3,11.0,18112.6,0.04,0.06,A,F,1992-05-27,1992-06-17,1992-06-16,TAKE BACK RETURN,AIR,etc quickly caref 2782854,115549,5550,3,26.0,40678.04,0.09,0.05,A,F,1992-10-28,1992-12-22,1992-11-05,NONE,FOB,e closely bold 4788772,90947,5966,3,41.0,79455.54,0.07,0.08,R,F,1994-03-21,1994-02-01,1994-03-30,COLLECT COD,RAIL,nd slyly special 2079559,152557,7588,2,8.0,12876.4,0.07,0.08,N,O,1997-03-22,1997-05-04,1997-03-24,DELIVER IN PERSON,AIR,eep evenly. furiousl @@ -176,7 +176,7 @@ l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discoun 2264930,121777,1778,4,50.0,89938.5,0.03,0.05,A,F,1994-11-25,1995-02-09,1994-12-10,NONE,SHIP,arefully final requests about 3301184,25983,8486,2,11.0,20998.78,0.04,0.04,R,F,1992-04-11,1992-03-16,1992-04-16,DELIVER IN PERSON,AIR,ly bold theodolites. regula 4311301,199395,9396,2,19.0,28393.41,0.07,0.0,A,F,1994-03-14,1994-04-07,1994-04-12,DELIVER IN PERSON,TRUCK,silent deposits. ideas wake furiously. blit -5752967,159056,6602,2,33.0,36796.65,0.09,0.08,A,F,1994-05-09,1994-06-20,1994-05-20,TAKE BACK RETURN,TRUCK,fluffily final accoun +5752967,159056,6602,2,33.0,36796.65,0.09,0.08,A,F,1994-05-09,1994-06-20,1994-05-20,TAKE BACK RETURN,TRUCK,fluffily final account 432641,57620,2631,3,44.0,69415.28,0.02,0.0,N,O,1996-11-10,1996-10-11,1996-11-16,DELIVER IN PERSON,TRUCK, busily along th 3637985,45770,8275,1,43.0,73778.11,0.0,0.05,R,F,1994-08-05,1994-05-23,1994-09-02,NONE,RAIL,final deposits. bo 3812933,99806,9807,1,39.0,70426.2,0.08,0.08,A,F,1995-01-04,1995-01-27,1995-01-09,NONE,RAIL,ly foxes. furiously @@ -184,7 +184,7 @@ l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discoun 5258176,138102,8103,2,19.0,21661.9,0.02,0.01,N,O,1996-02-11,1996-01-08,1996-02-21,COLLECT COD,TRUCK,ecial foxes. express instructions from th 5323333,156755,6756,3,1.0,1811.75,0.0,0.07,R,F,1993-06-20,1993-06-21,1993-06-26,COLLECT COD,SHIP,as are. slyly 4627239,149405,4434,3,39.0,56721.6,0.01,0.0,A,F,1995-01-04,1994-11-03,1995-01-27,COLLECT COD,REG AIR,ronic instructions snooze quic -1325699,135256,283,3,46.0,59397.5,0.1,0.07,R,F,1994-04-30,1994-04-09,1994-05-22,COLLECT COD,REG AIR,y dogged dependencies wake furiously alo +1325699,135256,283,3,46.0,59397.5,0.1,0.07,R,F,1994-04-30,1994-04-09,1994-05-22,COLLECT COD,REG AIR,y dogged dependencies wake furiously also 4510048,33140,5644,5,38.0,40779.32,0.02,0.01,A,F,1994-02-23,1994-05-14,1994-03-17,COLLECT COD,TRUCK,e slyly pending packages. ironic e 2376230,83724,8741,5,12.0,20492.64,0.04,0.08,N,O,1996-04-18,1996-05-05,1996-04-30,COLLECT COD,REG AIR,iously. bold excu 3723493,179858,9859,6,47.0,91078.95,0.06,0.06,N,O,1997-08-06,1997-08-28,1997-08-08,NONE,SHIP,ackages. ex @@ -274,7 +274,7 @@ l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discoun 1015746,64695,9708,1,26.0,43151.94,0.02,0.03,N,O,1996-12-22,1996-11-11,1997-01-01,COLLECT COD,MAIL,deposits boost furiously ironic pinto b 3413667,190352,353,5,4.0,5769.4,0.02,0.01,N,O,1996-03-20,1996-03-02,1996-04-10,DELIVER IN PERSON,AIR,ending platelets use final inst 5009376,120934,3447,3,32.0,62557.76,0.0,0.06,R,F,1993-05-26,1993-05-23,1993-06-23,NONE,AIR,"unusual, regular requests" -4902560,165983,5984,3,29.0,59420.42,0.05,0.01,A,F,1995-04-21,1995-03-18,1995-05-18,COLLECT COD,RAIL,nto beans integrate a +4902560,165983,5984,3,29.0,59420.42,0.05,0.01,A,F,1995-04-21,1995-03-18,1995-05-18,COLLECT COD,RAIL,not beans integrate a 3792645,35415,2925,2,50.0,67520.5,0.01,0.07,R,F,1992-07-22,1992-06-30,1992-07-30,DELIVER IN PERSON,TRUCK,ar packages across the caref 2360772,48879,6392,3,7.0,12795.09,0.1,0.07,N,O,1998-03-17,1998-05-29,1998-04-13,TAKE BACK RETURN,REG AIR,nic deposits a 30627,101081,6102,3,36.0,38954.88,0.06,0.08,A,F,1992-06-07,1992-08-07,1992-06-17,COLLECT COD,RAIL,e doggedly close patterns. fluffily regular @@ -297,5 +297,5 @@ l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discoun 5533862,119199,4222,1,9.0,10963.71,0.0,0.08,R,F,1992-03-26,1992-03-27,1992-03-27,COLLECT COD,MAIL,odolites lose around the accounts. quickly 4697219,12566,5068,3,32.0,47313.92,0.1,0.06,A,F,1994-12-21,1995-01-16,1995-01-04,TAKE BACK RETURN,AIR,lithely pending pinto beans. final 4648197,126007,6008,2,40.0,41320.0,0.0,0.08,N,O,1996-10-11,1996-11-21,1996-10-16,TAKE BACK RETURN,FOB,egular ideas. blithely special foxes -1444486,112754,288,5,46.0,81270.5,0.09,0.07,R,F,1993-09-22,1993-10-20,1993-10-17,NONE,RAIL,nto beans x-ray slowly along the idly i +1444486,112754,288,5,46.0,81270.5,0.09,0.07,R,F,1993-09-22,1993-10-20,1993-10-17,NONE,RAIL,not beans x-ray slowly along the idly i 5731301,130238,5265,2,15.0,19023.45,0.08,0.02,R,F,1992-08-11,1992-09-13,1992-08-25,DELIVER IN PERSON,SHIP,regular pac diff --git a/tests/data/nation.csv b/narwhals-testing/narwhals_testing/tests/data/nation.csv similarity index 98% rename from tests/data/nation.csv rename to narwhals-testing/narwhals_testing/tests/data/nation.csv index 90acb68221..ec94be6424 100644 --- a/tests/data/nation.csv +++ b/narwhals-testing/narwhals_testing/tests/data/nation.csv @@ -13,7 +13,7 @@ n_nationkey,n_name,n_regionkey,n_comment 11,IRAQ,4,pendencies; slyly express foxes integrate carefully across the reg 12,JAPAN,2, quickly final packages. furiously i 13,JORDAN,4,the slyly regular ideas. silent Tiresias affix slyly fu -14,KENYA,0,lyly special foxes. slyly regular deposits sleep carefully. carefully permanent accounts slee +14,KENYA,0,lyly special foxes. slyly regular deposits sleep carefully. carefully permanent accounts sleep 15,MOROCCO,0,ct blithely: blithely express accounts nag carefully. silent packages haggle carefully abo 16,MOZAMBIQUE,0, beans after the carefully regular accounts r 17,PERU,1,ly final foxes. blithely ironic accounts haggle. regular foxes about the regular deposits are furiously ir diff --git a/tests/data/orders.csv b/narwhals-testing/narwhals_testing/tests/data/orders.csv similarity index 98% rename from tests/data/orders.csv rename to narwhals-testing/narwhals_testing/tests/data/orders.csv index 718e416f4f..0e8b318851 100644 --- a/tests/data/orders.csv +++ b/narwhals-testing/narwhals_testing/tests/data/orders.csv @@ -33,11 +33,11 @@ o_orderkey,o_custkey,o_orderstatus,o_totalprice,o_orderdate,o_orderpriority,o_cl 900576,117205,O,203244.69,1995-07-20,5-LOW,Clerk#000000727,0,. slyly unusual pinto beans use blithe 4003268,92378,O,99744.96,1998-03-11,1-URGENT,Clerk#000000759,0,he pending pinto beans. furiously 4828640,19048,O,146652.9,1996-11-11,3-MEDIUM,Clerk#000000877,0,instructions sleep slyly upon the regul -5255009,56335,O,42374.21,1997-04-05,1-URGENT,Clerk#000000942,0, deposits sleep abov +5255009,56335,O,42374.21,1997-04-05,1-URGENT,Clerk#000000942,0, deposits sleep above 4892768,116281,O,272774.55,1997-12-04,5-LOW,Clerk#000000670,0,"r, bold deposits detect fluffily regular inst" 3200001,104536,F,243217.22,1994-09-22,1-URGENT,Clerk#000000494,0,ly regular instructions cajole furiously furiously even depos 3972166,20329,O,52286.28,1998-03-12,3-MEDIUM,Clerk#000000302,0,inal frets cajole furiously. requests wake carefu -264257,7079,F,176146.5,1993-07-12,5-LOW,Clerk#000000339,0,"ely. special, ironic asymptotes along the quickly even deposits shal" +264257,7079,F,176146.5,1993-07-12,5-LOW,Clerk#000000339,0,"ely. special, ironic asymptotes along the quickly even deposits shall" 4756773,88765,F,254595.35,1994-08-19,5-LOW,Clerk#000000212,0,sits boost fluffily. furi 4990823,48097,O,242274.0,1995-11-27,3-MEDIUM,Clerk#000000934,0,regular requests detect furiously above the slyly pending 2684551,85768,O,177524.5,1995-09-25,1-URGENT,Clerk#000000633,0,usly express instruc @@ -75,7 +75,7 @@ o_orderkey,o_custkey,o_orderstatus,o_totalprice,o_orderdate,o_orderpriority,o_cl 3561440,109618,O,82960.43,1996-04-17,2-HIGH,Clerk#000000181,0, deposits sleep blithely along the slyly final packages. never even foxes bo 1023815,82847,F,275148.63,1992-05-29,5-LOW,Clerk#000000747,0,ar accounts grow carefully 5353541,74698,O,258938.96,1997-02-24,3-MEDIUM,Clerk#000000507,0,"nts. unusual ideas eat blithely. final, express foxes haggle blithely silen" -4379846,149165,F,71078.45,1993-10-18,1-URGENT,Clerk#000000339,0,ed requests. quickly regular foxes wake. bold accoun +4379846,149165,F,71078.45,1993-10-18,1-URGENT,Clerk#000000339,0,ed requests. quickly regular foxes wake. bold account 701543,57976,F,137431.35,1994-09-15,1-URGENT,Clerk#000000925,0,ts haggle according to the carefully final pinto b 1407940,36460,O,87593.43,1996-02-26,1-URGENT,Clerk#000000866,0,d packages believe quick 3399648,40484,O,31669.67,1996-02-26,4-NOT SPECIFIED,Clerk#000000263,0, instructions against the slyly fluffy foxes use across the blithely unu @@ -103,7 +103,7 @@ o_orderkey,o_custkey,o_orderstatus,o_totalprice,o_orderdate,o_orderpriority,o_cl 2194592,12394,F,178911.72,1994-01-17,5-LOW,Clerk#000000018,0,leep against the pending requests 4564546,83698,F,65049.42,1993-08-20,5-LOW,Clerk#000000712,0,unusual excuses. final ideas print furiously according to th 4414789,83089,O,126020.34,1998-03-04,5-LOW,Clerk#000000995,0,regular packages are quickly boldly e -1227360,33952,F,128542.01,1995-02-12,4-NOT SPECIFIED,Clerk#000000824,0,e carefully silent dependencies slee +1227360,33952,F,128542.01,1995-02-12,4-NOT SPECIFIED,Clerk#000000824,0,e carefully silent dependencies sleep 654849,78118,O,252905.26,1996-01-07,2-HIGH,Clerk#000000589,0,"egular, permanent ideas. frets c" 2310950,137294,O,302415.34,1998-02-22,4-NOT SPECIFIED,Clerk#000000603,0, ironic foxes wake furiously regular i 4116707,110890,P,121078.65,1995-03-15,5-LOW,Clerk#000000519,0,l instructions? ironic accounts @@ -130,7 +130,7 @@ o_orderkey,o_custkey,o_orderstatus,o_totalprice,o_orderdate,o_orderpriority,o_cl 2423874,30103,O,105199.27,1995-08-09,5-LOW,Clerk#000000290,0,"o the regular, final requests. accounts accord" 4260867,97420,O,285147.75,1996-07-19,3-MEDIUM,Clerk#000000645,0,sts. quickly unusual theodolites integrate fluffily. ironic foxes nag furio 3400839,154,O,131425.98,1997-05-06,1-URGENT,Clerk#000000131,0,sly after the slyly bold pinto beans. unusual requests according to -5273089,9733,F,159836.76,1994-06-21,1-URGENT,Clerk#000000029,0,its. even accounts haggle carefully. regular multipliers nag throu +5273089,9733,F,159836.76,1994-06-21,1-URGENT,Clerk#000000029,0,its. even accounts haggle carefully. regular multipliers nag thru 3120614,123631,F,45061.71,1993-10-05,2-HIGH,Clerk#000000947,0,t quickly even packages. fu 3485698,27604,F,172415.37,1993-07-15,5-LOW,Clerk#000000840,0,r accounts after the final 772419,90065,F,230726.65,1992-05-05,3-MEDIUM,Clerk#000000689,0,kly dependencies. fluffily p @@ -147,7 +147,7 @@ o_orderkey,o_custkey,o_orderstatus,o_totalprice,o_orderdate,o_orderpriority,o_cl 254658,36109,F,113905.54,1993-01-26,3-MEDIUM,Clerk#000000396,0,he permanent dolphins. bravely ironic deposit 5705857,41288,O,127661.94,1998-04-10,1-URGENT,Clerk#000000473,0,ages. express pinto beans about the furiously blithe packages poach 2418850,31243,O,376913.99,1997-08-10,4-NOT SPECIFIED,Clerk#000000014,0,sts. quickly final pains sleep slyly fluffily regu -854690,1517,O,90556.7,1997-09-02,3-MEDIUM,Clerk#000000022,0,special requests slee +854690,1517,O,90556.7,1997-09-02,3-MEDIUM,Clerk#000000022,0,special requests sleep 1676292,22090,F,154252.81,1994-05-14,2-HIGH,Clerk#000000300,0,. slyly ironic dependencies are blithely after the carefully final asy 506080,37090,F,230634.12,1992-10-10,1-URGENT,Clerk#000000238,0,ptotes cajole furiously even instructions. slyly special pla 305921,99937,O,317008.05,1998-02-25,5-LOW,Clerk#000000949,0,se. carefully even acc @@ -157,7 +157,7 @@ o_orderkey,o_custkey,o_orderstatus,o_totalprice,o_orderdate,o_orderpriority,o_cl 4006118,66175,F,341451.28,1994-07-12,1-URGENT,Clerk#000000094,0,"lent deposits wake ironically regular, regular accounts. u" 2720416,94564,O,216593.14,1997-03-07,2-HIGH,Clerk#000000900,0,y silent ideas nag carefully even e 3880289,25021,F,153712.28,1992-04-25,3-MEDIUM,Clerk#000000715,0,into beans. even deposits cajole quickly careful -2813443,65093,F,105737.34,1994-05-01,3-MEDIUM,Clerk#000000730,0,ake blithely sly warthogs. quickly un +2813443,65093,F,105737.34,1994-05-01,3-MEDIUM,Clerk#000000730,0,ache blithely sly warthogs. quickly un 5443015,18190,F,94220.11,1992-12-05,1-URGENT,Clerk#000000410,0,thely final gifts. pinto beans boost carefully 860741,65924,F,162638.49,1993-01-10,3-MEDIUM,Clerk#000000458,0,ctions. quickly even accounts thrash furiously. final foxes wa 2891841,81217,O,37712.36,1995-06-29,5-LOW,Clerk#000000568,0,ounts around the final deposits cajole against the carefully final warhorses. @@ -201,7 +201,7 @@ o_orderkey,o_custkey,o_orderstatus,o_totalprice,o_orderdate,o_orderpriority,o_cl 5782112,19528,O,204357.61,1998-03-17,4-NOT SPECIFIED,Clerk#000000150,0,ages sleep idly at the fluffily final notornis. bold packages 1742342,148361,F,119012.1,1994-07-20,2-HIGH,Clerk#000000395,0, even deposits breach along the bravely even packages. slyly slow dep 2907489,120713,O,101963.59,1995-09-08,1-URGENT,Clerk#000000528,0, unusual theodolites cajole furiously. carefully bold -1419331,23707,F,51734.48,1994-10-06,4-NOT SPECIFIED,Clerk#000000756,0,"ual, regular pinto beans. final instructions alo" +1419331,23707,F,51734.48,1994-10-06,4-NOT SPECIFIED,Clerk#000000756,0,"ual, regular pinto beans. final instructions also" 2042247,48539,F,36492.64,1994-10-31,1-URGENT,Clerk#000000417,0,al platelets may haggle. quickly final packages snooze slyly. quickly 197635,81514,P,196982.01,1995-04-25,2-HIGH,Clerk#000000899,0,beans are carefully even frets. quickly even ideas use carefully 1016288,33697,O,64075.93,1997-05-04,1-URGENT,Clerk#000000304,0,ely carefully special dependencies? regular re @@ -251,10 +251,10 @@ o_orderkey,o_custkey,o_orderstatus,o_totalprice,o_orderdate,o_orderpriority,o_cl 2680391,141487,F,92285.27,1993-05-27,1-URGENT,Clerk#000000794,0,arefully after the blithely regular asymptotes. 2478464,113339,O,189618.54,1995-08-17,3-MEDIUM,Clerk#000000340,0, ironic accounts are among the fluffil 3987558,35812,O,423550.87,1995-12-25,3-MEDIUM,Clerk#000000340,0,lithely final accounts wake slyly across the stealthy requests. qu -5967520,29197,O,230376.53,1995-11-03,3-MEDIUM,Clerk#000000720,0,quests. furiously pending theodolites detect. accounts thrash quickly alo +5967520,29197,O,230376.53,1995-11-03,3-MEDIUM,Clerk#000000720,0,quests. furiously pending theodolites detect. accounts thrash quickly also 4663424,85157,F,116303.83,1994-03-16,1-URGENT,Clerk#000000242,0,- dependencies dazzle never ex 1064930,137557,O,78321.51,1997-12-18,4-NOT SPECIFIED,Clerk#000000883,0, across the carefully even packages! deposits cajole -3486342,10627,O,75631.74,1998-01-10,4-NOT SPECIFIED,Clerk#000000669,0,otes whithout the ironic accounts kindle +3486342,10627,O,75631.74,1998-01-10,4-NOT SPECIFIED,Clerk#000000669,0,otes without the ironic accounts kindle 14245,130894,F,84023.35,1993-02-12,1-URGENT,Clerk#000000975,0, the deposits. dinos about the blithely final sauternes integrate regula 5515845,142081,P,119578.7,1995-03-07,4-NOT SPECIFIED,Clerk#000000184,0,e fluffily furiously regular packages. depths use slyly amon 3562566,91910,O,280490.32,1997-07-20,1-URGENT,Clerk#000000778,0,ts. quickly ironic accounts @@ -286,7 +286,7 @@ o_orderkey,o_custkey,o_orderstatus,o_totalprice,o_orderdate,o_orderpriority,o_cl 3117284,124786,O,1076.11,1998-01-24,3-MEDIUM,Clerk#000000404,0,the quickly ironic 3942023,96334,O,171914.9,1996-09-05,3-MEDIUM,Clerk#000000647,0,regular deposits. platelets haggle carefully 489729,126796,O,125058.93,1996-02-28,2-HIGH,Clerk#000000041,0,ove the slyly final ideas thrash furiously ironic accounts. accounts serve -553508,26806,F,42543.12,1994-04-05,3-MEDIUM,Clerk#000000188,0,ic deposits haggle quickly furiously final packages. instructions slee +553508,26806,F,42543.12,1994-04-05,3-MEDIUM,Clerk#000000188,0,ic deposits haggle quickly furiously final packages. instructions sleep 487234,90928,P,401337.49,1995-04-27,5-LOW,Clerk#000000600,0,ar platelets affix finally special requests. carefully pendi 5957986,79001,O,89731.16,1998-02-07,5-LOW,Clerk#000000342,0,"s the ironic ideas. special, regular foxes " 3630880,53920,O,55328.17,1997-08-11,5-LOW,Clerk#000000792,0,y behind the carefully bold grouches. furiously even dependencies diff --git a/tests/data/part.csv b/narwhals-testing/narwhals_testing/tests/data/part.csv similarity index 99% rename from tests/data/part.csv rename to narwhals-testing/narwhals_testing/tests/data/part.csv index f6450f5d57..ff7514ba31 100644 --- a/tests/data/part.csv +++ b/narwhals-testing/narwhals_testing/tests/data/part.csv @@ -90,7 +90,7 @@ p_partkey,p_name,p_mfgr,p_brand,p_type,p_size,p_container,p_retailprice,p_commen 96320,grey hot violet blush steel,Manufacturer#3,Brand#31,SMALL PLATED COPPER,26,SM PKG,1316.32,cajole acros 178526,tan dodger peach rosy tomato,Manufacturer#5,Brand#55,LARGE PLATED NICKEL,41,JUMBO CAN,1604.52, specia 32135,navy spring red misty orchid,Manufacturer#5,Brand#53,MEDIUM POLISHED COPPER,20,MED BAG,1067.13,kly even de -24876,yellow chiffon dim wheat cream,Manufacturer#1,Brand#12,MEDIUM POLISHED NICKEL,1,LG DRUM,1800.87,d platelets slee +24876,yellow chiffon dim wheat cream,Manufacturer#1,Brand#12,MEDIUM POLISHED NICKEL,1,LG DRUM,1800.87,d platelets sleep 14126,indian white turquoise almond brown,Manufacturer#4,Brand#42,STANDARD BRUSHED TIN,25,SM JAR,1040.12,nic package 128965,cyan powder red blush dodger,Manufacturer#4,Brand#43,SMALL ANODIZED STEEL,46,WRAP PACK,1993.96,kly bold re 150502,cornsilk goldenrod lime lavender dodger,Manufacturer#3,Brand#34,LARGE PLATED STEEL,17,JUMBO CAN,1552.5,tions inte @@ -108,7 +108,7 @@ p_partkey,p_name,p_mfgr,p_brand,p_type,p_size,p_container,p_retailprice,p_commen 154715,moccasin aquamarine smoke blanched lemon,Manufacturer#5,Brand#51,PROMO BRUSHED TIN,49,LG JAR,1769.71,ully quickly regular 132173,grey wheat honeydew floral ivory,Manufacturer#4,Brand#44,STANDARD BRUSHED NICKEL,47,SM CAN,1205.17,"row regular, exp" 156307,powder thistle indian smoke lime,Manufacturer#3,Brand#31,SMALL POLISHED STEEL,36,WRAP PACK,1363.3,al packages nag. -148545,medium almond burlywood cornflower blush,Manufacturer#2,Brand#21,ECONOMY POLISHED NICKEL,46,JUMBO CASE,1593.54,uickly regular accoun +148545,medium almond burlywood cornflower blush,Manufacturer#2,Brand#21,ECONOMY POLISHED NICKEL,46,JUMBO CASE,1593.54,uickly regular account 48541,chartreuse firebrick thistle bisque burlywood,Manufacturer#2,Brand#23,PROMO ANODIZED COPPER,19,SM CAN,1489.54, can haggle quickly 75676,royal khaki violet yellow ivory,Manufacturer#2,Brand#24,MEDIUM PLATED NICKEL,47,JUMBO BOX,1651.67,le beyon 59541,medium grey mint khaki orchid,Manufacturer#3,Brand#35,STANDARD BURNISHED NICKEL,23,JUMBO BOX,1500.54,ly fluffily th @@ -205,7 +205,7 @@ p_partkey,p_name,p_mfgr,p_brand,p_type,p_size,p_container,p_retailprice,p_commen 154592,lavender dark puff linen bisque,Manufacturer#1,Brand#15,LARGE BURNISHED COPPER,44,WRAP PKG,1646.59,t the f 108486,seashell orange red wheat green,Manufacturer#2,Brand#22,MEDIUM POLISHED NICKEL,40,MED JAR,1494.48,ts sleep never regu 12422,dim papaya violet ghost brown,Manufacturer#5,Brand#52,MEDIUM ANODIZED TIN,19,JUMBO CASE,1334.42,ix fl -142665,yellow green peach medium spring,Manufacturer#2,Brand#21,SMALL PLATED TIN,43,MED PACK,1707.66,uests. express i +142665,yellow green peach medium spring,Manufacturer#2,Brand#21,SMALL PLATED TIN,43,MED PACK,1707.66,quests. express i 35810,cornflower almond pink antique wheat,Manufacturer#5,Brand#53,STANDARD BURNISHED NICKEL,23,LG BOX,1745.81,"al, final pinto beans " 113678,almond royal pale rose turquoise,Manufacturer#4,Brand#43,STANDARD BURNISHED STEEL,45,WRAP PKG,1691.67,"nst the ironic, regula" 146853,wheat firebrick moccasin lemon steel,Manufacturer#4,Brand#41,SMALL PLATED TIN,47,WRAP BOX,1899.85,re regularly @@ -230,7 +230,7 @@ p_partkey,p_name,p_mfgr,p_brand,p_type,p_size,p_container,p_retailprice,p_commen 148165,brown yellow pink peach ivory,Manufacturer#3,Brand#33,ECONOMY ANODIZED STEEL,40,SM JAR,1213.16,iously fina 176788,tomato lace blush metallic burnished,Manufacturer#2,Brand#21,STANDARD BRUSHED TIN,20,LG PKG,1864.78,kages 132780,sky pale cyan peach brown,Manufacturer#4,Brand#42,LARGE POLISHED TIN,13,WRAP CASE,1812.78,s! fluffily bold s -134788,khaki sandy almond olive peru,Manufacturer#1,Brand#13,STANDARD ANODIZED STEEL,27,SM PACK,1822.78,nto bean +134788,khaki sandy almond olive peru,Manufacturer#1,Brand#13,STANDARD ANODIZED STEEL,27,SM PACK,1822.78,not bean 158045,firebrick rose frosted light navajo,Manufacturer#5,Brand#51,MEDIUM BRUSHED NICKEL,5,WRAP PACK,1103.04,uction 126055,lawn ghost puff pale almond,Manufacturer#4,Brand#45,STANDARD BURNISHED STEEL,15,MED JAR,1081.05,ecial 126429,mint brown grey white cornsilk,Manufacturer#5,Brand#54,STANDARD BURNISHED STEEL,41,WRAP CASE,1455.42,gular accounts use fi @@ -287,7 +287,7 @@ p_partkey,p_name,p_mfgr,p_brand,p_type,p_size,p_container,p_retailprice,p_commen 8945,orchid tomato cyan almond indian,Manufacturer#5,Brand#51,ECONOMY BRUSHED BRASS,3,SM DRUM,1853.94,uriously alon 151581,red magenta almond dodger sandy,Manufacturer#2,Brand#24,SMALL PLATED NICKEL,34,LG PACK,1632.58,along the quickly 122939,black cyan light pink firebrick,Manufacturer#1,Brand#15,ECONOMY ANODIZED STEEL,49,JUMBO BOX,1961.93,cial asymptote -54105,cream medium white honeydew lime,Manufacturer#3,Brand#32,LARGE PLATED STEEL,13,JUMBO CASE,1059.1,nto beans boost among +54105,cream medium white honeydew lime,Manufacturer#3,Brand#32,LARGE PLATED STEEL,13,JUMBO CASE,1059.1,not beans boost among 159333,royal honeydew mint papaya tomato,Manufacturer#3,Brand#31,MEDIUM PLATED NICKEL,43,MED CAN,1392.33,posits are acro 58705,maroon forest midnight seashell papaya,Manufacturer#4,Brand#44,ECONOMY ANODIZED TIN,4,JUMBO BAG,1663.7,ly along 146124,bisque pink sienna metallic blush,Manufacturer#2,Brand#21,STANDARD POLISHED TIN,18,LG CAN,1170.12,accounts. fu diff --git a/tests/data/partsupp.csv b/narwhals-testing/narwhals_testing/tests/data/partsupp.csv similarity index 98% rename from tests/data/partsupp.csv rename to narwhals-testing/narwhals_testing/tests/data/partsupp.csv index b5c7aa8216..d8fb2c8e88 100644 --- a/tests/data/partsupp.csv +++ b/narwhals-testing/narwhals_testing/tests/data/partsupp.csv @@ -43,7 +43,7 @@ ps_partkey,ps_suppkey,ps_availqty,ps_supplycost,ps_comment 120891,8428,4934,848.82,"its might boost furiously. accounts cajole slyly. quickly ironic foxes sleep blithely above the regular, careful sheaves. slyl" 32832,5336,7661,572.83,mpress carefully. furiously special escapades along the carefully express asymptotes affix above the bold ideas. ironic accounts use brave deposits. slowly pending acc 78456,8457,8423,589.92,"sheaves. fluffily pending deposits wake fluffily pending foxes. instructions nag. bold, even packages sleep fu" -151618,1619,915,819.73,nto beans x-ray fluffily express requests. boldly ironic f +151618,1619,915,819.73,not beans x-ray fluffily express requests. boldly ironic f 164142,6659,6040,979.81,"h slyly bold pinto beans. final, even requests ha" 106726,9237,8640,435.41,"es the evenly final theodolites. unusual, stealthy orbits sleep blithely. slyly special courts are blithely regular accounts. pending excu" 188461,980,963,736.5,"nstructions boost slyly final packages? fluffily stealthy theodolites promise regular, ironic instru" @@ -54,7 +54,7 @@ ps_partkey,ps_suppkey,ps_availqty,ps_supplycost,ps_comment 121539,9076,3049,439.25,sts along the quickly special platelets haggle against the carefully ironic courts. blithely quick deposits haggle regular packages. furiously final deposits affix against the ironic 4235,1736,8821,575.26,"ickly ironic foxes. blithely bold platelets sleep. blithely regular platelets along the even, " 38302,806,3152,556.42,"y express instructions nag special, even pinto beans; final, final accounts detect fluffily. quickly iron" -19657,7161,5057,675.52, final accounts. regular requests promise furiously? even accoun +19657,7161,5057,675.52, final accounts. regular requests promise furiously? even account 49466,1971,8326,476.05,"ges. blithely final foxes according to the quickly even deposits dazzle quickly ideas. blithely regular requests sleep around the express, regular deposits. quickly final packages " 63741,6248,3749,816.57,en pinto beans: carefully furious attainments use. slyly even ideas kindle slyly above the regular packages. blithely final pinto beans among the requests s 119536,2048,7699,599.14,ix furiously blithely regular dolphins. slyly express requests wake evenly. accounts boost unusual pinto beans. accounts haggle above the ironic theodolites. reg @@ -127,14 +127,14 @@ ps_partkey,ps_suppkey,ps_availqty,ps_supplycost,ps_comment 99320,9321,9058,314.08,en accounts. ironic dependencies cajole. packages integrate carefully against the always pending theodolites. slyly ironic requests 76386,6387,3252,95.76,r foxes nag fluffily even instructions. quickly ironic packages wake blithely. slyly regular deposits use carefully blithely regular accounts. furi 88173,8174,2878,257.95,gular deposits sleep slyly slyly even foxes. furiousl -121326,1327,3616,968.42," are after the blithely silent dependencies. requests are against the silent, regular packages. ironic, unusual ideas mold across the always bold reques" +121326,1327,3616,968.42," are after the blithely silent dependencies. requests are against the silent, regular packages. ironic, unusual ideas mold across the always bold request" 182314,4833,5813,474.43," wake. special, even packages wake doggedly even pinto beans. pending pinto beans wake. carefully even re" 12003,2004,1272,408.48,ing to the accounts. final excuses run furiously slyly even ideas. ruthless realms boost. furiously bo 196136,1175,1976,235.5,ncies. ironically express pinto beans use ruthlessly about the blithely even theodolites. carefully slow pinto beans cajole fluffily across the blithely even packages. f -80876,877,4359,182.43,lly blithely even courts. furiously ironic platelets across the pending requests affix slyly across the fluffily regular requests. slyly expres +80876,877,4359,182.43,lly blithely even courts. furiously ironic platelets across the pending requests affix slyly across the fluffily regular requests. slyly express 58964,1470,3341,687.26,grate across the furiously even foxes. fluffily final theodolites cajole carefully. carefully silent ideas to the even deposits mold 12817,321,8172,112.79, theodolites was furiously. permanently final courts detect against the furiously ironic -29625,9626,8750,113.91,"arefully. final, final platelets cajole; instructions hinder. idle deposits cajole whithout the furiously regular pinto beans. carefully special dependencies across the blithely regular accounts are" +29625,9626,8750,113.91,"arefully. final, final platelets cajole; instructions hinder. idle deposits cajole without the furiously regular pinto beans. carefully special dependencies across the blithely regular accounts are" 172076,7111,4886,798.39,"lyly. ironic pinto beans detect final, unusual instructions. silent instructions haggle slyly. slyly unusual orbits cajole regular pinto beans. final att" 19764,9765,4408,377.44,lites cajole above the blithely furious packages. carefully regular packages x-ray furiously above the requests. furiously final deposits wake. quickly final 5724,3225,4184,35.17,"final, ironic frets sleep among the pending packages. regular, even theodolites are blithely. deposits integrate according to the unusual decoys. regular requests thrash fur" @@ -144,7 +144,7 @@ ps_partkey,ps_suppkey,ps_availqty,ps_supplycost,ps_comment 156320,6321,3155,501.34,beans integrate quickly! fluffily silent warhorses affix furiously. slyly final dolphins boost 115559,5560,603,176.55,"ies nag permanently. accounts against the close, even packages nag above " 195838,3396,2214,496.69,"deas play never alongside of the theodolites. dependencies sleep after the regular, bold deposits. qui" -149791,2306,3208,2.31,cording to the patterns. slyly ironic ideas along the thinly even accounts cajole furiously bold packag +149791,2306,3208,2.31,cording to the patterns. slyly ironic ideas along the thinly even accounts cajole furiously bold package 11713,9217,9482,453.2,"t unusual, ironic courts. regular, express epitaphs should have to wake" 33186,8193,6441,722.04,ckages! ironic deposits wake fluffily; slyly silent theodolites sleep furiously furiously regular d 17459,9961,9667,331.07,"ial ideas boost platelets. fluffily final packages after the pending, final deposits sleep furiously regular accounts. blithely ironic asympto" @@ -154,7 +154,7 @@ ps_partkey,ps_suppkey,ps_availqty,ps_supplycost,ps_comment 137967,7968,7644,670.02,ronic frays against the platelets are final packa 36196,1203,8637,156.69,ly bold excuses. instructions cajole furiously bold accounts. foxes cajole care 117353,7354,9096,520.1,"kages nag blithely even, express foxes. regular accounts are across the furiously bold foxes. carefully regular excuses nag blit" -79005,4020,6555,705.59,le silently among the deposits. even dependencies detect slyly. deposits grow fluffily. doggedly regular hockey players accordin +79005,4020,6555,705.59,le silently among the deposits. even dependencies detect slyly. deposits grow fluffily. doggedly regular hockey players according 61279,3786,3976,264.38,"ular accounts sleep platelets. blithely regular deposits haggle during the regular accounts. ironic, final accounts after the even, special accounts sleep slyly among the quickly exp" 183441,3442,9508,103.66,lyly regular dependencies. ironic foxes haggle dugouts. packages wake quickly furiously express depths. slyly express dependencies impress around the requests-- furiously even pac 148159,3188,6194,988.99,"egular packages boost unusual, silent theodolites" @@ -168,7 +168,7 @@ ps_partkey,ps_suppkey,ps_availqty,ps_supplycost,ps_comment 142519,62,9602,639.6,se. theodolites wake slyly. theodolites sleep always. slyly silent dol 103999,6510,2660,995.16," according to the final packages. ironic dugouts boost according to the furious, final packages. final, regular deposits haggle fluffily. pending instructions detect fur" 185166,7685,3999,434.49,es hang furiously furiously ironic warthogs. packages can cajole. blithely special accounts after the final pinto beans sleep quickly packages. f -77772,7773,7263,863.2,ajole. accounts doubt above the slyly ironic packages. bold accoun +77772,7773,7263,863.2,ajole. accounts doubt above the slyly ironic packages. bold account 52348,2349,4685,618.99,"ously silent accounts. quickly ironic pinto beans are regular, final excuses. furiously special deposits integrate. quietly regular requests cajole slyly exp" 108302,3323,5497,368.51,"quickly final accounts thrash fluffily against the blithely bold deposits. unusual, " 190340,2860,2144,534.33,thy theodolites against the accounts are blithely carefully idle instruction @@ -237,7 +237,7 @@ ps_partkey,ps_suppkey,ps_availqty,ps_supplycost,ps_comment 93540,3541,2390,749.76,"carefully final excuses eat carefully. regular, silent theodolites wake blithely excuses! ironic packages will are at the even, blithe for" 123628,8653,2816,826.58,above the furiously final deposits: quickly special asymptotes about the furiously final deposits use 196218,8738,8197,969.91,regular pinto beans are slyly ironic dolphins. furiously pending request -146767,4310,7760,756.73, deposits hang above the doggedly final deposits. fluffily ironic instructions slee +146767,4310,7760,756.73, deposits hang above the doggedly final deposits. fluffily ironic instructions sleep 39109,4116,8091,451.45,"deposits. carefully silent requests run. furiously even dolphins use! regular, silent asymptotes cajole carefully pending packages. slyly express packages sleep ca" 97333,7334,1968,174.32," furiously bold deposits wake slyly. carefully special instructions use slyly. furiously regular requests boost blithely. regular, unusual accounts cajole f" 59774,7290,3280,242.06,accounts cajole blithely. furiously thin depths are quickly final theodoli @@ -246,9 +246,9 @@ ps_partkey,ps_suppkey,ps_availqty,ps_supplycost,ps_comment 199305,9306,2769,770.45, accounts? escapades sleep. even foxes wake furiously. carefully final deposits detect. express de 6179,1180,3867,891.17,arefully ironic accounts haggle thinly. slyly even requests alongside of the ironic foxes are enticingly around the accounts. 90643,5662,3064,915.58,iments. requests wake furiously. furiously bold packages sleep slyly. express frays boost. furiously regular -132579,7606,5382,981.17,"ges affix according to the carefully silent pearls. ironic, ironic packages boost furiously silent, final reques" +132579,7606,5382,981.17,"ges affix according to the carefully silent pearls. ironic, ironic packages boost furiously silent, final request" 51951,1952,4534,706.98,"e slyly along the unusual, pending accounts. fluffily even requests nod slyly furiously unusual foxes. regular, regular deposits cajole furiousl" -30979,5986,5369,251.37,uests use according to the slyly final packages. carefully special instructions sleep furiously among the blithely silent dugouts. even dependencies nag slyl +30979,5986,5369,251.37,quests use according to the slyly final packages. carefully special instructions sleep furiously among the blithely silent dugouts. even dependencies nag slyl 188837,8838,3568,983.15,"al packages sleep permanently along the bold instructions. pending, ironic theodolites beneath the slyly special pinto beans are slyly past the exp" 189884,9885,6169,211.09," quickly among the packages. carefully idle Tiresias boost blithely along the fluffily regular accounts. furiously unusual foxes against the pending, final pinto beans wake " 194262,4263,5304,91.42,onic requests integrate carefully across the carefully diff --git a/tests/data/region.csv b/narwhals-testing/narwhals_testing/tests/data/region.csv similarity index 100% rename from tests/data/region.csv rename to narwhals-testing/narwhals_testing/tests/data/region.csv diff --git a/tests/data/supplier.csv b/narwhals-testing/narwhals_testing/tests/data/supplier.csv similarity index 97% rename from tests/data/supplier.csv rename to narwhals-testing/narwhals_testing/tests/data/supplier.csv index 386dc518c6..922bc79886 100644 --- a/tests/data/supplier.csv +++ b/narwhals-testing/narwhals_testing/tests/data/supplier.csv @@ -1,18 +1,18 @@ s_suppkey,s_name,s_address,s_nationkey,s_phone,s_acctbal,s_comment 6501,Supplier#000006501,T8Ktj3i46Bizye3UlxjvYGX,24,34-947-812-7804,5536.05,uffily special deposits alongside of the carefull -3576,Supplier#000003576,"atHpBTWtEAnXnPHYnIWIIQL8rpSEhqs,j9iBVVwb",16,26-106-371-3903,7178.9,nto beans haggle alongside of the unusual depos -9659,Supplier#000009659,YJeV9wEcOqu,10,20-668-283-2499,6693.6,uests sleep platelets. slyly pending foxes about the regular accounts cajole according to the e -7020,Supplier#000007020,f4925t9SqQ fn8xdZVfr83D7NHgeBLPU3G5Dl5eK,13,23-899-965-3786,1530.95," kindle final, bold platelets. carefully even deposits cajole fur" +3576,Supplier#000003576,"atHpBTWtEAnXnPHYnIWIIQL8rpSEhqs,j9iBVVwb",16,26-106-371-3903,7178.9,not beans haggle alongside of the unusual depos +9659,Supplier#000009659,YJeV9wEcOqu,10,20-668-283-2499,6693.6,quests sleep platelets. slyly pending foxes about the regular accounts cajole according to the e +7020,Supplier#000007020,f4925t9SqQ fn8xdZVfr83D7NHeBLPU3G5Dl5eK,13,23-899-965-3786,1530.95," kindle final, bold platelets. carefully even deposits cajole fur" 5183,Supplier#000005183,okmKWcA2efyhP7LsqELkYswbOb0l,0,10-649-978-6034,-629.63,tes. slyly unusual theodolites x-ray alongside of the even accounts. carefully 3938,Supplier#000003938,"G5u,FqS R1Egibz97hDD9zIABEvDsU9",18,28-643-172-2015,2289.05,unusual accounts. quickly bold instructions wake fur 4344,Supplier#000004344,j2VgTk2QTvCjOK4wLyaAKKKIO2d ,1,11-675-830-4768,1263.79,le quickly final packages! blithely i -3478,Supplier#000003478,F9xOT8EL6x6W2gRYjJKK8qWFtKCanPnmc,22,32-511-233-7238,2754.66,venly special foxes. slyly regular reques +3478,Supplier#000003478,F9xOT8EL6x6W2gRYjJKK8qWFtKCanPnmc,22,32-511-233-7238,2754.66,venly special foxes. slyly regular request 9920,Supplier#000009920,jdPWpNIgbG3ZCi,0,10-214-567-7809,102.96,. carefully ironic requests detect slyly at the bl 6412,Supplier#000006412,dtRx9ukKzoF4EvhNo8rcg,0,10-984-296-5608,7488.1,eas must haggle slyly quickly ruthless accounts. unusual deposits solve furi 8515,Supplier#000008515,8qZYxSO1gqGEsbCAG4hKxyh Hyz0V,19,29-357-508-1973,9430.81,sleep furiously furiously regular dolphin 3401,Supplier#000003401,TLzrstXTc9zRbZnwiyq,15,25-299-425-9900,4167.25,ilent deposits. blithely regular dependencies alongside of the requ 9384,Supplier#000009384,"2T7uz,tcBWF5ok",24,34-393-170-2099,5776.82, theodolites. blithely regular theodolites nag fluffily slyly sile -7129,Supplier#000007129,TCiflHeBzy0f,9,19-204-131-2284,1026.87,uests under the pending requ +7129,Supplier#000007129,TCiflHeBzy0f,9,19-204-131-2284,1026.87,quests under the pending requ 9184,Supplier#000009184,"yTAAyGKx,Yo4LRQqHg9YBw1,",11,21-416-185-1079,142.38,ouches believe carefully. 793,Supplier#000000793,2WdY5sm9jfsNzXHARl,18,28-379-479-7140,7044.94,ic theodolites sleep carefully. fluffil 228,Supplier#000000228,Ct72ryCOQ8Rzi6FAj6Ppwe0 0,14,24-920-216-6514,2291.35,carefully ruthless requests hang. fluffily ironic depths detect furiou @@ -30,7 +30,7 @@ s_suppkey,s_name,s_address,s_nationkey,s_phone,s_acctbal,s_comment 2530,Supplier#000002530,YcgPIu8YaQnGXWf19xW7TQ6XuB4KDVtfxxvm9,2,12-634-424-9935,6345.68, requests nag carefully. furiously special accounts cajole thinly about t 972,Supplier#000000972,fG18d4b1LRLS14XNsr761rzU8SQb52,12,22-291-368-8958,-203.99,o the foxes. silent platelets serv 9057,Supplier#000009057,S3StLg7qBMwwCjtWN,12,22-542-862-8502,2716.56, accounts. permanently ironic requests cajole. carefully express dependencies against -8332,Supplier#000008332,NUouIMmKt7bI,11,21-836-667-3398,2365.08,ld requests use furiously across the fi +8332,Supplier#000008332,NYouIMmKt7bI,11,21-836-667-3398,2365.08,ld requests use furiously across the fi 8681,Supplier#000008681,7Df1grFLJR2coIMwa3G3l Xbu28Ge,17,27-206-598-2594,7446.18, blithely along the furiously express accounts-- furiously regular 4286,Supplier#000004286,"dz6sUMw8X2TEkvYAN4EH8J,DmDDHQC7Nxs",10,20-857-469-4413,9656.61, haggle blithely furiously even pinto beans. ironic accounts haggle bl 2896,Supplier#000002896,l9FRupHVQz4By8 SMXPZJBd53m0OS,2,12-800-846-2689,1062.01,lithely regular ideas. carefully even foxes nag @@ -47,7 +47,7 @@ s_suppkey,s_name,s_address,s_nationkey,s_phone,s_acctbal,s_comment 9558,Supplier#000009558,FONKME0t7ZJhnjn9VL5,22,32-762-137-5858,8231.61,g to the carefully even brai 8410,Supplier#000008410,S IooRsID1 KOSEQHgQZwmLPkxrC5FLgJQDl4,3,13-188-800-4871,4875.41,y even ideas. furiously even requests are silently. quickly spec 1072,Supplier#000001072,"d3b6hjMT,G",17,27-579-309-4798,3583.12,gular packages among the carefully ironic packages cajole slyly quickly bold foxes. -8363,Supplier#000008363,Uyfj1IHln 1Df3IlZoXJqwr,12,22-986-422-9102,6907.92,"cial, final packages sleep ideas. final dolphins coul" +8363,Supplier#000008363,Uyfj1IHln 1Df3IlZoXJqwr,12,22-986-422-9102,6907.92,"cial, final packages sleep ideas. final dolphins could" 4106,Supplier#000004106,nh6B1AQVTWJ5gzwPQem9SYlj,12,22-995-670-6182,5835.62,sits. carefully silent deposits use. furiously regular 4169,Supplier#000004169,12eV lwPVPnnnN2,20,30-542-513-7503,7926.37, asymptotes haggle quickly. blithely ironic deposits cajole i 5051,Supplier#000005051,cxMHAYB50hm3W0J7DJjPA,22,32-592-547-7141,6044.11,quickly along the carefully silent pinto beans; care @@ -72,17 +72,17 @@ s_suppkey,s_name,s_address,s_nationkey,s_phone,s_acctbal,s_comment 3731,Supplier#000003731,xh294VX7PwFBckoNkZUvWn,23,33-849-804-9421,7602.8,"usy asymptotes. express, final accounts cajole slyly. silent instructions dazzle furiously ab" 7599,Supplier#000007599,k1lF5ORbRJcG znDcaPZzwY,13,23-515-832-7179,9499.75,slyly regular accounts. slyly regular pinto beans are beneath the fl 4721,Supplier#000004721,SoFcm31CfnPI6f4GZFHq,17,27-951-525-7255,9326.27, dependencies. carefully ironic accounts mold fluffily iron -6161,Supplier#000006161,sORW5faZPEYZNKlNMNQVcVLE4RJ0GOek,14,24-735-112-2298,1085.77,al dolphins. ironic dolphins nod furiously accordin +6161,Supplier#000006161,sORW5faZPEYZNKlNMNQVcVLE4RJ0GOek,14,24-735-112-2298,1085.77,al dolphins. ironic dolphins nod furiously according 3212,Supplier#000003212,",S4fS1Rd9o9N isxjHUh9CWx5",20,30-148-178-8673,5132.32,"ounts cajole. ironic, final packages cajole carefully. furiously regular accounts cajole carefully " 512,Supplier#000000512,fCdcxfoWaedDpKnWxfOwzjoOLtLRO4,15,25-617-226-9364,4762.66,"ag slyly bold ideas. quickly regular patterns are slyly. silent, final pinto beans aft" 7750,Supplier#000007750,"wynJH wDC4qn,Z3kTtNi",18,28-680-484-7044,6662.89,"tain quickly. even pinto beans sleep blithely. unusual, regular d" 9801,Supplier#000009801,GCgH6fu 0h2o,12,22-293-385-2049,7796.18,"ffily final theodolites haggle carefully. fluffily unusual requests sleep. close, silent platelets c" -9307,Supplier#000009307,sq37Hz9lhLFH19noXTs3I9SIn5UlJc9F0St3y,7,17-529-917-1541,6847.31,ake fluffily by the slyly special accounts. regul +9307,Supplier#000009307,sq37Hz9lhLFH19noXTs3I9SIn5UlJc9F0St3y,7,17-529-917-1541,6847.31,ache fluffily by the slyly special accounts. regul 5775,Supplier#000005775,D9DkFw1WWess99q0RdfoJGwX3r8WF,17,27-149-720-8879,1645.4, accounts. express deposits detect carefully. dep 4350,Supplier#000004350,td6scckSyBpFnHdkCYUZzUyzCuCSxCGbxk,1,11-991-829-4202,-784.44,carefully. carefully silent asymptot 9383,Supplier#000009383,683aNz64WHOLmNadSDSI1lV,24,34-298-463-2083,467.12, lose blithely. regular requests nag around the ironic theodolites? furiously 5586,Supplier#000005586,54v0YxYGta VC3VmZ7CdDy7vtbRoQmzMVfuos,17,27-329-481-4646,8468.41,sits. carefully express instruc -3299,Supplier#000003299,2jrHengzPPoPumkGSeSrGU0y5zmEq,24,34-125-967-8542,7292.91,"nal platelets? final, ironic packages integrate carefully furiously bold packag" +3299,Supplier#000003299,2jrHengzPPoPumkGSeSrGU0y5zmEq,24,34-125-967-8542,7292.91,"nal platelets? final, ironic packages integrate carefully furiously bold package" 3339,Supplier#000003339,"glXb4lALgs5Gt6Q,qtqPW1r gXemRcecK8k9t",0,10-892-842-9387,5308.31,nal ideas; carefully special requests after the even requests wake ruthlessly about the furiously 8452,Supplier#000008452,"G7 F,8OuO2D,3ttOtV3WgQD",2,12-686-389-2091,7550.43,symptotes believe carefully from the q 4345,Supplier#000004345,"C0fq3L8Eru,R",9,19-934-108-4550,8462.97,nding deposits. furiously unusual asymptotes wake. slyly express deposits run pending account @@ -110,7 +110,7 @@ s_suppkey,s_name,s_address,s_nationkey,s_phone,s_acctbal,s_comment 7179,Supplier#000007179,GSM7ujZlUcldtUBUoqAVes2QR,9,19-737-245-9748,8756.45,osits nag slyly above the furiously even asymptotes. blithely regular dependencies 213,Supplier#000000213,",zTrWDNQynZp4sZbH39YsY8DlKO09wAYiOuKZETL",18,28-317-938-6979,2616.54,p thinly. packages sleep sl 5393,Supplier#000005393,3Flf u7o0TvdlYF1w9dgabUUHebylnqUL1o,15,25-830-731-1125,7182.06,"instructions along the pending, even excuses " -7168,Supplier#000007168,2PIZk CYLxd x51tnHMh9A3Vga1f2ZFGXQX,8,18-771-260-7057,160.37,ions nag carefully. carefully quick instructions above the furiously bold ideas slee +7168,Supplier#000007168,2PIZk CYLxd x51tnHMh9A3Vga1f2ZFGXQX,8,18-771-260-7057,160.37,ions nag carefully. carefully quick instructions above the furiously bold ideas sleep 2908,Supplier#000002908,q7biO3B7AEsRrIi,17,27-220-405-2567,-986.42, cajole furiously blithely bold gifts. furiously stealthy excuses wak 1718,Supplier#000001718,1cK10FqXe8NvZrciweU6qD,21,31-256-122-2861,2315.87,hely regular requests. furiously silent packages boost. ironic pinto beans use carefully ironic acc 9528,Supplier#000009528,E0PdEyzllFTfEf95e8pGovHYjA0 JJqklN517 X ,2,12-181-831-1307,7825.7, after the furiously unusual theodolites. furiously regular deposits solve. furiously express @@ -137,7 +137,7 @@ s_suppkey,s_name,s_address,s_nationkey,s_phone,s_acctbal,s_comment 4847,Supplier#000004847,Bzj2t2fGt8ACT4EPUyL1BdZtOLvAX3mZPqrF,3,13-711-383-8713,1583.58,"arefully even ideas wake blithely even, reg" 3692,Supplier#000003692,hjrLDiHzh5NQ1P5HHkfynwB4B86Yr2Szj9W,15,25-535-577-3607,7730.65,furiously regular packages cajole quickly. slyly regular platelets cajole quickly 6626,Supplier#000006626,dP2pMgCsNCoH8TLURZNAA34pKMa9TuwcIKEs0M5K,16,26-897-536-6470,933.88,ccounts at the instructions affix quickly evenly express de -6857,Supplier#000006857,zOFv9739yrLrgRyKxDlmMJQ5bVvexFTi,17,27-737-864-6129,8032.79,uests alongside of the foxes haggle furiousl +6857,Supplier#000006857,zOFv9739yrLrgRyKxDlmMJQ5bVvexFTi,17,27-737-864-6129,8032.79,quests alongside of the foxes haggle furiousl 2975,Supplier#000002975,"Wv,X0V0o7htym",4,14-822-991-8478,4692.62,heodolites. furiously final requests haggle alon 2922,Supplier#000002922,n5FVAODB1fdb,23,33-289-294-9337,8416.83,c ideas. blithely unusual foxes alongside of the instructions are exp 961,Supplier#000000961,IFLGn00vU 0fXWOzO872YOqpwXt4gOIwj5,15,25-911-416-1546,4139.88,ans must cajole final deposits @@ -147,14 +147,14 @@ s_suppkey,s_name,s_address,s_nationkey,s_phone,s_acctbal,s_comment 8729,Supplier#000008729,wNRZKfnbBzuL5NZ5nY,11,21-824-778-8668,1445.94,"furiously idle, final theodolites. ironic pinto beans us" 8942,Supplier#000008942,"qb6zbQOvGIk4CJUCmvl,0xJs 5lvWO",18,28-435-943-3392,260.51,ully silent accounts. slyly pending pinto beans boost. carefully ironic instructions after the f 6025,Supplier#000006025,"4Hfvyvo,gWNMVPFlpDSJYUkhjIE,8GW0y37",6,16-124-250-1297,4605.35,requests use carefully at the fluffily final theodolites. furiously final excuses are: depos -7369,Supplier#000007369," Owccgf7WE4cUEyyQfEC35PY07srSD66P6PS,K",9,19-532-859-9127,6187.85,. final deposits affix agai +7369,Supplier#000007369," Owccgf7WE4cUEyyQfEC35PY07srSD66P6PS,K",9,19-532-859-9127,6187.85,. final deposits affix again 7271,Supplier#000007271,So15MwWFKtQgNNhONxIKYg 5t92zRwcgaFk,11,21-463-180-1307,1088.7," packages. fluffily pending ideas sleep? regular, expr" 8739,Supplier#000008739,xvwTcRLRsbpc,20,30-741-515-8775,3878.91,"counts. final, bold foxes cajole. dep" 2096,Supplier#000002096,HxuzMufyArbbf3uFR16 EpUgGKRYhyhVOast3d6r,3,13-621-558-5424,8661.02,fully express foxes. slyly ruthless requests use furiously 151,Supplier#000000151,ZJN0XdqgbPYRi2Ts3xBy3,22,32-960-568-5148,8561.72,carefully special accounts. furiously bold foxes 2661,Supplier#000002661,x83U5cuMA8fRLyS6fP9av5D,4,14-798-808-1495,3170.7, the furiously final packages. carefully regular accounts use slyly special ideas! blithely care 4669,Supplier#000004669,J7kUUOSTiVZH8lRz0twDr,14,24-346-311-7142,-522.03, accounts haggle slyly special accounts. thinly unusual requests nag fluffily regular depos -6511,Supplier#000006511,fvNwfYWDFG4Ir a7bnCAKGER3ReuX4m,8,18-355-691-7466,7520.19, unusual courts. carefully regular accoun +6511,Supplier#000006511,fvNwfYWDFG4Ir a7bnCAKGER3ReuX4m,8,18-355-691-7466,7520.19, unusual courts. carefully regular account 2230,Supplier#000002230,"Fm0GC,0,EetZrzO",19,29-334-821-6402,1300.29,regular attainments cajole to the blithely ironic foxes. slyly unusual 2498,Supplier#000002498,6wB2 UkUcCtowyGj4UANn1pIXSZS5P,5,15-815-470-5030,6008.19,ests. never special ideas acr 6227,Supplier#000006227,v8StJxCoUz3oPK,7,17-905-469-8595,1266.52,"ound the quietly bold accounts nag quickly ironic, bold requests. ironic, reg" @@ -221,7 +221,7 @@ s_suppkey,s_name,s_address,s_nationkey,s_phone,s_acctbal,s_comment 8621,Supplier#000008621,zEmKUNsV 23nuMGXMUrd8vEyql IX0,1,11-797-806-5347,4175.93,ld packages. carefully spe 4302,Supplier#000004302,uSh0tNyZjPNzxdFoUZC,8,18-532-605-1462,7307.76,detect furiously. even asy 8408,Supplier#000008408,9ORxRFOOYPg74Lj Be8O8 PNQyy,19,29-475-811-8890,9917.49,ffily bold packages nag against the s -367,Supplier#000000367,nr8wRQ a5LXXess,22,32-458-198-9557,8488.53,"ect. quickly pending deposits sleep carefully even, express dependencies." +367,Supplier#000000367,nr8wRQ a5LXXess,22,32-458-198-9557,8488.53,"etc. quickly pending deposits sleep carefully even, express dependencies." 7337,Supplier#000007337,"Es,V3luXGT6h2msOTnIu",5,15-236-375-7373,2996.46,ges. carefully unusual requests grow fl 7279,Supplier#000007279,mhzeQVozg0bGzYVFewzW5QH Di7D,15,25-499-550-4752,111.76,e among the quickly bold deposits. slyly regular excus 1676,Supplier#000001676,F1TnXtTXUxedezUVgQCgshGkcEHNK9iqGFA,18,28-184-394-2196,9371.1, finally. carefully even foxes sleep slyly. unusual requests do @@ -257,7 +257,7 @@ s_suppkey,s_name,s_address,s_nationkey,s_phone,s_acctbal,s_comment 7575,Supplier#000007575,sHtpfYf35DpJjo6DSYzpP,6,16-929-131-1821,7182.26,ckly furious multipliers. ironic dolphins r 97,Supplier#000000097,f oaJRYkUDO3ZLBVoq,4,14-618-678-1789,6642.22,riously even pains. quickly special depende 1013,Supplier#000001013,AI9ODzBzWgnny28PHBei5M2lUFdD9,22,32-194-698-3365,7914.45, the blithely silent accounts. q -5288,Supplier#000005288,"rAn,yftAaKVJxN4abATLHmoFqwOJx",16,26-212-331-6862,2818.15,quests. carefully final dolphins wake carefully thr +5288,Supplier#000005288,"rAn,yftAaKVJxN4abATLHmoFqwOJx",16,26-212-331-6862,2818.15,quests. carefully final dolphins wake carefully the 3440,Supplier#000003440,SX8VBEyE4Jwr9U6X1nr9da0YKjZTPX,23,33-495-208-7899,9822.22,urts. special accounts use quickly. 9828,Supplier#000009828,N4FNrNyg7k2Aw9ZJKuaO027g5MouB9S2XQmoD,17,27-853-353-5536,1909.22,es integrate furiously-- regular tithes are blithely. ideas detect enticingl 2704,Supplier#000002704,5JBuhdahaXmngwHIIzEa tUxClI,2,12-227-559-6658,1641.36,"al, ironic ideas might are along the furiously final packages. carefully bold requests cajole blithe" @@ -278,7 +278,7 @@ s_suppkey,s_name,s_address,s_nationkey,s_phone,s_acctbal,s_comment 590,Supplier#000000590,hJ9yzgWlCtPBYJ6wKrPmkGnxz4qL,9,19-277-247-1833,-12.84,ely against the slyly pending pinto beans. q 9878,Supplier#000009878,ZGvzOzglmJqRIDFC0JwFi,16,26-864-214-4496,9856.55,. deposits after the furiously final requests wake slyly among the furiously ironic deposits. regula 2359,Supplier#000002359,"hRRuIG7Bl2,MDdQS7yggbx0MA",1,11-732-769-1277,9493.58,"bold, pending accounts: even instructions cajole. quickly bold pac" -7578,Supplier#000007578,iifQqkKc1jwnvTvdpn,19,29-432-333-1258,-258.71,ounts sleep furiously along the b +7578,Supplier#000007578,ifQqkKc1jwnvTvdpn,19,29-432-333-1258,-258.71,ounts sleep furiously along the b 5145,Supplier#000005145,Et2wifzTBr5PKc0,2,12-292-675-8158,1056.91,its. regular asymptotes sleep enticingly against the fluffily ironic pinto beans. s 7251,Supplier#000007251,5hXrqiJEKv6VUQqJP7V1gzCs6,22,32-623-165-6389,9657.6," deposits boost according to the final, even dolphins. quickly final pinto beans sleep " 3027,Supplier#000003027, VmIs92LsbZw2aGki,0,10-170-124-1414,8510.97,y special dolphins cajole carefully carefully final requests. quickl diff --git a/tests/dtypes/__init__.py b/narwhals-testing/narwhals_testing/tests/dependencies/__init__.py similarity index 100% rename from tests/dtypes/__init__.py rename to narwhals-testing/narwhals_testing/tests/dependencies/__init__.py diff --git a/tests/dependencies/imports_test.py b/narwhals-testing/narwhals_testing/tests/dependencies/imports_test.py similarity index 100% rename from tests/dependencies/imports_test.py rename to narwhals-testing/narwhals_testing/tests/dependencies/imports_test.py diff --git a/tests/dependencies/is_into_dataframe_test.py b/narwhals-testing/narwhals_testing/tests/dependencies/is_into_dataframe_test.py similarity index 100% rename from tests/dependencies/is_into_dataframe_test.py rename to narwhals-testing/narwhals_testing/tests/dependencies/is_into_dataframe_test.py diff --git a/tests/dependencies/is_into_series_test.py b/narwhals-testing/narwhals_testing/tests/dependencies/is_into_series_test.py similarity index 100% rename from tests/dependencies/is_into_series_test.py rename to narwhals-testing/narwhals_testing/tests/dependencies/is_into_series_test.py diff --git a/tests/dependencies/is_narwhals_dataframe_test.py b/narwhals-testing/narwhals_testing/tests/dependencies/is_narwhals_dataframe_test.py similarity index 100% rename from tests/dependencies/is_narwhals_dataframe_test.py rename to narwhals-testing/narwhals_testing/tests/dependencies/is_narwhals_dataframe_test.py diff --git a/tests/dependencies/is_narwhals_lazyframe_test.py b/narwhals-testing/narwhals_testing/tests/dependencies/is_narwhals_lazyframe_test.py similarity index 99% rename from tests/dependencies/is_narwhals_lazyframe_test.py rename to narwhals-testing/narwhals_testing/tests/dependencies/is_narwhals_lazyframe_test.py index 0e4c6e1bd9..16b7d36027 100644 --- a/tests/dependencies/is_narwhals_lazyframe_test.py +++ b/narwhals-testing/narwhals_testing/tests/dependencies/is_narwhals_lazyframe_test.py @@ -2,9 +2,10 @@ from typing import TYPE_CHECKING +from tests.utils import Constructor + import narwhals as nw from narwhals.stable.v1.dependencies import is_narwhals_lazyframe -from tests.utils import Constructor if TYPE_CHECKING: from tests.utils import Constructor diff --git a/tests/dependencies/is_narwhals_series_test.py b/narwhals-testing/narwhals_testing/tests/dependencies/is_narwhals_series_test.py similarity index 100% rename from tests/dependencies/is_narwhals_series_test.py rename to narwhals-testing/narwhals_testing/tests/dependencies/is_narwhals_series_test.py diff --git a/tests/dependencies/is_native_dataframe_series_raise_test.py b/narwhals-testing/narwhals_testing/tests/dependencies/is_native_dataframe_series_raise_test.py similarity index 100% rename from tests/dependencies/is_native_dataframe_series_raise_test.py rename to narwhals-testing/narwhals_testing/tests/dependencies/is_native_dataframe_series_raise_test.py diff --git a/tests/dependencies/is_numpy_scalar_test.py b/narwhals-testing/narwhals_testing/tests/dependencies/is_numpy_scalar_test.py similarity index 100% rename from tests/dependencies/is_numpy_scalar_test.py rename to narwhals-testing/narwhals_testing/tests/dependencies/is_numpy_scalar_test.py diff --git a/tests/dependencies/is_pandas_dataframe_test.py b/narwhals-testing/narwhals_testing/tests/dependencies/is_pandas_dataframe_test.py similarity index 100% rename from tests/dependencies/is_pandas_dataframe_test.py rename to narwhals-testing/narwhals_testing/tests/dependencies/is_pandas_dataframe_test.py diff --git a/tests/dependencies/is_pandas_index_test.py b/narwhals-testing/narwhals_testing/tests/dependencies/is_pandas_index_test.py similarity index 100% rename from tests/dependencies/is_pandas_index_test.py rename to narwhals-testing/narwhals_testing/tests/dependencies/is_pandas_index_test.py diff --git a/tests/expr_and_series/__init__.py b/narwhals-testing/narwhals_testing/tests/dtypes/__init__.py similarity index 100% rename from tests/expr_and_series/__init__.py rename to narwhals-testing/narwhals_testing/tests/dtypes/__init__.py diff --git a/tests/dtypes/dtypes_test.py b/narwhals-testing/narwhals_testing/tests/dtypes/dtypes_test.py similarity index 99% rename from tests/dtypes/dtypes_test.py rename to narwhals-testing/narwhals_testing/tests/dtypes/dtypes_test.py index 33fa61ac08..78bfbc5b9d 100644 --- a/tests/dtypes/dtypes_test.py +++ b/narwhals-testing/narwhals_testing/tests/dtypes/dtypes_test.py @@ -6,9 +6,6 @@ from typing import TYPE_CHECKING, Any, Literal import pytest - -import narwhals as nw -from narwhals.exceptions import InvalidOperationError, PerformanceWarning from tests.utils import ( PANDAS_VERSION, POLARS_VERSION, @@ -17,12 +14,16 @@ pyspark_session, ) +import narwhals as nw +from narwhals.exceptions import InvalidOperationError, PerformanceWarning + if TYPE_CHECKING: from collections.abc import Iterable - from narwhals.typing import IntoFrame, IntoSeries, NonNestedDType from tests.utils import Constructor, ConstructorPandasLike, NestedOrEnumDType + from narwhals.typing import IntoFrame, IntoSeries, NonNestedDType + @pytest.mark.parametrize("time_unit", ["us", "ns", "ms"]) @pytest.mark.parametrize("time_zone", ["Europe/Rome", timezone.utc, None]) diff --git a/tests/dtypes/pandas_extension_dtypes_test.py b/narwhals-testing/narwhals_testing/tests/dtypes/pandas_extension_dtypes_test.py similarity index 100% rename from tests/dtypes/pandas_extension_dtypes_test.py rename to narwhals-testing/narwhals_testing/tests/dtypes/pandas_extension_dtypes_test.py diff --git a/tests/dtypes/pyarrow_extension_dtypes_test.py b/narwhals-testing/narwhals_testing/tests/dtypes/pyarrow_extension_dtypes_test.py similarity index 100% rename from tests/dtypes/pyarrow_extension_dtypes_test.py rename to narwhals-testing/narwhals_testing/tests/dtypes/pyarrow_extension_dtypes_test.py diff --git a/tests/enum_test.py b/narwhals-testing/narwhals_testing/tests/enum_test.py similarity index 100% rename from tests/enum_test.py rename to narwhals-testing/narwhals_testing/tests/enum_test.py diff --git a/tests/expr_and_series/cat/__init__.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/__init__.py similarity index 100% rename from tests/expr_and_series/cat/__init__.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/__init__.py diff --git a/tests/expr_and_series/abs_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/abs_test.py similarity index 99% rename from tests/expr_and_series/abs_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/abs_test.py index 547ff9d8dc..10666af7c8 100644 --- a/tests/expr_and_series/abs_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/abs_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, ConstructorEager, assert_equal_data +import narwhals as nw + def test_abs(constructor: Constructor) -> None: df = nw.from_native(constructor({"a": [1, 2, 3, -4, 5]})) diff --git a/tests/expr_and_series/all_horizontal_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/all_horizontal_test.py similarity index 97% rename from tests/expr_and_series/all_horizontal_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/all_horizontal_test.py index d980b3def3..323edaa68c 100644 --- a/tests/expr_and_series/all_horizontal_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/all_horizontal_test.py @@ -4,9 +4,9 @@ from typing import Any import pytest +from tests.utils import POLARS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import POLARS_VERSION, Constructor, ConstructorEager, assert_equal_data def test_allh(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/any_all_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/any_all_test.py similarity index 99% rename from tests/expr_and_series/any_all_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/any_all_test.py index 6b6cc6e35f..448f9d3f8d 100644 --- a/tests/expr_and_series/any_all_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/any_all_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, ConstructorEager, assert_equal_data +import narwhals as nw + def test_any_all(constructor: Constructor) -> None: df = nw.from_native( diff --git a/tests/expr_and_series/any_horizontal_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/any_horizontal_test.py similarity index 100% rename from tests/expr_and_series/any_horizontal_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/any_horizontal_test.py index 04f0cba76c..1d855a739b 100644 --- a/tests/expr_and_series/any_horizontal_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/any_horizontal_test.py @@ -3,9 +3,9 @@ from contextlib import nullcontext as does_not_raise import pytest +from tests.utils import Constructor, assert_equal_data import narwhals as nw -from tests.utils import Constructor, assert_equal_data def test_anyh(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/any_value_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/any_value_test.py similarity index 100% rename from tests/expr_and_series/any_value_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/any_value_test.py index e665fbd03c..9f4ae8b64e 100644 --- a/tests/expr_and_series/any_value_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/any_value_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import DUCKDB_VERSION, PYARROW_VERSION, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, PYARROW_VERSION, assert_equal_data if TYPE_CHECKING: from tests.utils import Constructor, ConstructorEager diff --git a/tests/expr_and_series/arithmetic_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/arithmetic_test.py similarity index 100% rename from tests/expr_and_series/arithmetic_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/arithmetic_test.py index af0c464e5b..8f4f8b23d7 100644 --- a/tests/expr_and_series/arithmetic_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/arithmetic_test.py @@ -5,8 +5,6 @@ import hypothesis.strategies as st import pytest from hypothesis import assume, given - -import narwhals as nw from tests.utils import ( DASK_VERSION, DUCKDB_VERSION, @@ -16,6 +14,8 @@ assert_equal_data, ) +import narwhals as nw + @pytest.mark.parametrize( ("attr", "rhs", "expected"), diff --git a/tests/expr_and_series/binary_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/binary_test.py similarity index 100% rename from tests/expr_and_series/binary_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/binary_test.py index 6140ead120..3eb74008c7 100644 --- a/tests/expr_and_series/binary_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/binary_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DASK_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import DASK_VERSION, Constructor, assert_equal_data def test_expr_binary(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/bool_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/bool_test.py similarity index 100% rename from tests/expr_and_series/bool_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/bool_test.py diff --git a/tests/expr_and_series/cast_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/cast_test.py similarity index 100% rename from tests/expr_and_series/cast_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/cast_test.py index cfadaff347..7c5cec6797 100644 --- a/tests/expr_and_series/cast_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/cast_test.py @@ -4,8 +4,6 @@ from typing import TYPE_CHECKING, cast import pytest - -import narwhals as nw from tests.utils import ( PANDAS_VERSION, PYARROW_VERSION, @@ -16,6 +14,8 @@ time_unit_compat, ) +import narwhals as nw + if TYPE_CHECKING: from collections.abc import Mapping diff --git a/tests/expr_and_series/dt/__init__.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/cat/__init__.py similarity index 100% rename from tests/expr_and_series/dt/__init__.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/cat/__init__.py diff --git a/tests/expr_and_series/cat/get_categories_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/cat/get_categories_test.py similarity index 100% rename from tests/expr_and_series/cat/get_categories_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/cat/get_categories_test.py index 6f984ff7ce..ec577a48b9 100644 --- a/tests/expr_and_series/cat/get_categories_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/cat/get_categories_test.py @@ -1,10 +1,10 @@ from __future__ import annotations import pytest +from tests.utils import PYARROW_VERSION, ConstructorEager, assert_equal_data import narwhals as nw from narwhals.exceptions import InvalidOperationError -from tests.utils import PYARROW_VERSION, ConstructorEager, assert_equal_data data = {"a": ["one", "two", "two"]} diff --git a/tests/expr_and_series/clip_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/clip_test.py similarity index 100% rename from tests/expr_and_series/clip_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/clip_test.py index 382133f23c..ab8225a6ca 100644 --- a/tests/expr_and_series/clip_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/clip_test.py @@ -1,10 +1,10 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw from narwhals.exceptions import MultiOutputExpressionError -from tests.utils import Constructor, ConstructorEager, assert_equal_data @pytest.mark.parametrize( diff --git a/tests/expr_and_series/coalesce_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/coalesce_test.py similarity index 100% rename from tests/expr_and_series/coalesce_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/coalesce_test.py index 5311b39c85..124b4de508 100644 --- a/tests/expr_and_series/coalesce_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/coalesce_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data def test_coalesce_numeric(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/concat_str_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/concat_str_test.py similarity index 100% rename from tests/expr_and_series/concat_str_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/concat_str_test.py index ad8c47e3df..9480db5367 100644 --- a/tests/expr_and_series/concat_str_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/concat_str_test.py @@ -3,9 +3,9 @@ from typing import Callable import pytest +from tests.utils import POLARS_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import POLARS_VERSION, Constructor, assert_equal_data pytest.importorskip("pyarrow") import pyarrow as pa diff --git a/tests/expr_and_series/cos_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/cos_test.py similarity index 100% rename from tests/expr_and_series/cos_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/cos_test.py index 4aa936d9bf..bd8318543c 100644 --- a/tests/expr_and_series/cos_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/cos_test.py @@ -4,8 +4,6 @@ from typing import TYPE_CHECKING import pytest - -import narwhals as nw from tests.utils import ( PANDAS_VERSION, PYARROW_VERSION, @@ -14,6 +12,8 @@ assert_equal_data, ) +import narwhals as nw + if TYPE_CHECKING: from narwhals.typing import DTypeBackend diff --git a/tests/expr_and_series/count_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/count_test.py similarity index 99% rename from tests/expr_and_series/count_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/count_test.py index c3f34ee132..ea2b775c62 100644 --- a/tests/expr_and_series/count_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/count_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, ConstructorEager, assert_equal_data +import narwhals as nw + def test_count(constructor: Constructor) -> None: data = {"a": [1, 3, 2], "b": [4, None, 6], "z": [7.0, None, None]} diff --git a/tests/expr_and_series/cum_count_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/cum_count_test.py similarity index 100% rename from tests/expr_and_series/cum_count_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/cum_count_test.py index f25c27f1c3..411afc0f40 100644 --- a/tests/expr_and_series/cum_count_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/cum_count_test.py @@ -1,8 +1,6 @@ from __future__ import annotations import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, POLARS_VERSION, @@ -11,6 +9,8 @@ assert_equal_data, ) +import narwhals as nw + data = {"a": ["x", "y", None, "z"]} expected = {"cum_count": [1, 2, 2, 3], "reverse_cum_count": [3, 2, 1, 1]} diff --git a/tests/expr_and_series/cum_max_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/cum_max_test.py similarity index 100% rename from tests/expr_and_series/cum_max_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/cum_max_test.py index 82cf5ba179..c6ef8a0ed0 100644 --- a/tests/expr_and_series/cum_max_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/cum_max_test.py @@ -1,8 +1,6 @@ from __future__ import annotations import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, PANDAS_VERSION, @@ -12,6 +10,8 @@ assert_equal_data, ) +import narwhals as nw + data = {"a": [1, 3, None, 2]} expected = {"cum_max": [1, 3, None, 3], "reverse_cum_max": [3, 3, None, 2]} diff --git a/tests/expr_and_series/cum_min_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/cum_min_test.py similarity index 100% rename from tests/expr_and_series/cum_min_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/cum_min_test.py index 43fc1f5b81..8b290eb06f 100644 --- a/tests/expr_and_series/cum_min_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/cum_min_test.py @@ -1,8 +1,6 @@ from __future__ import annotations import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, PANDAS_VERSION, @@ -14,6 +12,8 @@ is_windows, ) +import narwhals as nw + data = {"a": [3, 1, None, 2]} expected = {"cum_min": [3, 1, None, 1], "reverse_cum_min": [1, 1, None, 2]} diff --git a/tests/expr_and_series/cum_prod_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/cum_prod_test.py similarity index 100% rename from tests/expr_and_series/cum_prod_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/cum_prod_test.py index 778c48bc67..91032454b7 100644 --- a/tests/expr_and_series/cum_prod_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/cum_prod_test.py @@ -1,8 +1,6 @@ from __future__ import annotations import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, PANDAS_VERSION, @@ -12,6 +10,8 @@ assert_equal_data, ) +import narwhals as nw + data = {"a": [1, 2, None, 3]} expected = {"cum_prod": [1, 2, None, 6], "reverse_cum_prod": [6, 6, None, 3]} diff --git a/tests/expr_and_series/cum_sum_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/cum_sum_test.py similarity index 100% rename from tests/expr_and_series/cum_sum_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/cum_sum_test.py index f3f0f780db..2549cd37ce 100644 --- a/tests/expr_and_series/cum_sum_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/cum_sum_test.py @@ -1,8 +1,6 @@ from __future__ import annotations import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, POLARS_VERSION, @@ -13,6 +11,8 @@ is_windows, ) +import narwhals as nw + data = {"arg entina": [1, 2, None, 4]} expected = {"cum_sum": [1, 3, None, 7], "reverse_cum_sum": [7, 6, None, 4]} diff --git a/tests/expr_and_series/diff_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/diff_test.py similarity index 100% rename from tests/expr_and_series/diff_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/diff_test.py index dc7440541e..00fcae60bf 100644 --- a/tests/expr_and_series/diff_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/diff_test.py @@ -1,8 +1,6 @@ from __future__ import annotations import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, POLARS_VERSION, @@ -11,6 +9,8 @@ assert_equal_data, ) +import narwhals as nw + data = {"i": [0, 1, 2, 3, 4], "b": [1, 2, 3, 5, 3], "c": [5, 4, 3, 2, 1]} diff --git a/tests/expr_and_series/division_by_zero_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/division_by_zero_test.py similarity index 100% rename from tests/expr_and_series/division_by_zero_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/division_by_zero_test.py index 6e8313b522..78e170f411 100644 --- a/tests/expr_and_series/division_by_zero_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/division_by_zero_test.py @@ -3,10 +3,10 @@ from typing import Any, Callable import pytest +from tests.utils import POLARS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw from narwhals._utils import zip_strict -from tests.utils import POLARS_VERSION, Constructor, ConstructorEager, assert_equal_data data: dict[str, list[float]] = { "int": [-2, 0, 2], diff --git a/tests/expr_and_series/double_selected_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/double_selected_test.py similarity index 100% rename from tests/expr_and_series/double_selected_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/double_selected_test.py index 48b76222ec..f9a4294b1d 100644 --- a/tests/expr_and_series/double_selected_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/double_selected_test.py @@ -1,10 +1,10 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, assert_equal_data import narwhals as nw from narwhals.exceptions import MultiOutputExpressionError -from tests.utils import Constructor, assert_equal_data def test_double_selected(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/double_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/double_test.py similarity index 99% rename from tests/expr_and_series/double_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/double_test.py index de6a1afb09..95a65a11e6 100644 --- a/tests/expr_and_series/double_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/double_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, assert_equal_data +import narwhals as nw + def test_double(constructor: Constructor) -> None: data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/expr_and_series/drop_nulls_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/drop_nulls_test.py similarity index 100% rename from tests/expr_and_series/drop_nulls_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/drop_nulls_test.py index d067552eb6..db990d4425 100644 --- a/tests/expr_and_series/drop_nulls_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/drop_nulls_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data def test_drop_nulls(constructor_eager: ConstructorEager) -> None: diff --git a/tests/expr_and_series/list/__init__.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/__init__.py similarity index 100% rename from tests/expr_and_series/list/__init__.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/dt/__init__.py diff --git a/tests/expr_and_series/dt/convert_time_zone_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/convert_time_zone_test.py similarity index 100% rename from tests/expr_and_series/dt/convert_time_zone_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/dt/convert_time_zone_test.py index 65d1a6e3b6..c5f80a8d78 100644 --- a/tests/expr_and_series/dt/convert_time_zone_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/convert_time_zone_test.py @@ -5,8 +5,6 @@ from zoneinfo import ZoneInfo import pytest - -import narwhals as nw from tests.utils import ( PANDAS_VERSION, POLARS_VERSION, @@ -16,6 +14,8 @@ pyspark_session, ) +import narwhals as nw + if TYPE_CHECKING: from tests.utils import ConstructorEager diff --git a/tests/expr_and_series/dt/datetime_attributes_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/datetime_attributes_test.py similarity index 100% rename from tests/expr_and_series/dt/datetime_attributes_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/dt/datetime_attributes_test.py index c7bf55e7c0..6fce44ca78 100644 --- a/tests/expr_and_series/dt/datetime_attributes_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/datetime_attributes_test.py @@ -4,9 +4,9 @@ from typing import TYPE_CHECKING, cast import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data if TYPE_CHECKING: import dask.dataframe as dd diff --git a/tests/expr_and_series/dt/datetime_duration_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/datetime_duration_test.py similarity index 100% rename from tests/expr_and_series/dt/datetime_duration_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/dt/datetime_duration_test.py index b84ecfa66e..91ccf2a849 100644 --- a/tests/expr_and_series/dt/datetime_duration_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/datetime_duration_test.py @@ -4,9 +4,9 @@ from typing import Literal import pytest +from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data data = { "a": [None, timedelta(minutes=1, seconds=1, milliseconds=1, microseconds=1)], diff --git a/tests/expr_and_series/dt/offset_by_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/offset_by_test.py similarity index 100% rename from tests/expr_and_series/dt/offset_by_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/dt/offset_by_test.py index dd4cc5dd85..750fc1dbcc 100644 --- a/tests/expr_and_series/dt/offset_by_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/offset_by_test.py @@ -3,8 +3,6 @@ from datetime import date, datetime, timezone import pytest - -import narwhals as nw from tests.utils import ( PANDAS_VERSION, Constructor, @@ -13,6 +11,8 @@ is_windows, ) +import narwhals as nw + data = { "a": [datetime(2021, 3, 1, 12, 34, 56, 49012), datetime(2020, 1, 2, 2, 4, 14, 715123)] } diff --git a/tests/expr_and_series/dt/ordinal_day_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/ordinal_day_test.py similarity index 100% rename from tests/expr_and_series/dt/ordinal_day_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/dt/ordinal_day_test.py index d10dc537f4..35f88a0c01 100644 --- a/tests/expr_and_series/dt/ordinal_day_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/ordinal_day_test.py @@ -5,9 +5,9 @@ import hypothesis.strategies as st import pytest from hypothesis import given +from tests.utils import PANDAS_VERSION import narwhals as nw -from tests.utils import PANDAS_VERSION pytest.importorskip("pandas") import pandas as pd diff --git a/tests/expr_and_series/dt/replace_time_zone_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/replace_time_zone_test.py similarity index 100% rename from tests/expr_and_series/dt/replace_time_zone_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/dt/replace_time_zone_test.py index 1c9dff7d59..f062ee2b73 100644 --- a/tests/expr_and_series/dt/replace_time_zone_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/replace_time_zone_test.py @@ -5,8 +5,6 @@ from zoneinfo import ZoneInfo import pytest - -import narwhals as nw from tests.utils import ( PANDAS_VERSION, Constructor, @@ -15,6 +13,8 @@ pyspark_session, ) +import narwhals as nw + if TYPE_CHECKING: from tests.utils import ConstructorEager diff --git a/tests/expr_and_series/dt/timestamp_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/timestamp_test.py similarity index 100% rename from tests/expr_and_series/dt/timestamp_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/dt/timestamp_test.py index e199fcac76..c70cd0efa9 100644 --- a/tests/expr_and_series/dt/timestamp_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/timestamp_test.py @@ -6,8 +6,6 @@ import hypothesis.strategies as st import pytest from hypothesis import given - -import narwhals as nw from tests.utils import ( PANDAS_VERSION, POLARS_VERSION, @@ -18,6 +16,8 @@ time_unit_compat, ) +import narwhals as nw + if TYPE_CHECKING: from narwhals.typing import IntoSeriesT diff --git a/tests/expr_and_series/dt/to_string_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/to_string_test.py similarity index 100% rename from tests/expr_and_series/dt/to_string_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/dt/to_string_test.py index 4fd4c14c66..fa73345737 100644 --- a/tests/expr_and_series/dt/to_string_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/to_string_test.py @@ -4,9 +4,9 @@ from typing import Any import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data, is_windows import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data, is_windows data = { "a": [datetime(2021, 3, 1, 12, 34, 56, 49000), datetime(2020, 1, 2, 2, 4, 14, 715000)] diff --git a/tests/expr_and_series/dt/total_minutes_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/total_minutes_test.py similarity index 100% rename from tests/expr_and_series/dt/total_minutes_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/dt/total_minutes_test.py index 55958cf5d7..f10795703b 100644 --- a/tests/expr_and_series/dt/total_minutes_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/total_minutes_test.py @@ -5,9 +5,9 @@ import hypothesis.strategies as st import pytest from hypothesis import given +from tests.utils import PANDAS_VERSION import narwhals as nw -from tests.utils import PANDAS_VERSION pytest.importorskip("pandas") import pandas as pd diff --git a/tests/expr_and_series/dt/truncate_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/truncate_test.py similarity index 100% rename from tests/expr_and_series/dt/truncate_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/dt/truncate_test.py index 40ce18d428..e73e314986 100644 --- a/tests/expr_and_series/dt/truncate_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/dt/truncate_test.py @@ -4,9 +4,9 @@ from zoneinfo import ZoneInfo import pytest +from tests.utils import POLARS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import POLARS_VERSION, Constructor, ConstructorEager, assert_equal_data data = { "a": [datetime(2021, 3, 1, 12, 34, 56, 49012), datetime(2020, 1, 2, 2, 4, 14, 715123)] diff --git a/tests/expr_and_series/ewm_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/ewm_test.py similarity index 100% rename from tests/expr_and_series/ewm_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/ewm_test.py index a3afae154b..93fb9c9125 100644 --- a/tests/expr_and_series/ewm_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/ewm_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data data = {"a": [1, 1, 2], "b": [1, 2, 3]} diff --git a/tests/expr_and_series/exclude_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/exclude_test.py similarity index 100% rename from tests/expr_and_series/exclude_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/exclude_test.py index 4aa39478d2..a596a696da 100644 --- a/tests/expr_and_series/exclude_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/exclude_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import assert_equal_data import narwhals as nw -from tests.utils import assert_equal_data if TYPE_CHECKING: from tests.utils import Constructor diff --git a/tests/expr_and_series/exp_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/exp_test.py similarity index 100% rename from tests/expr_and_series/exp_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/exp_test.py index 7bfcd5c404..c1a5c6f553 100644 --- a/tests/expr_and_series/exp_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/exp_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data data = {"a": [-1, 0, 1, 2, 4]} diff --git a/tests/expr_and_series/fill_nan_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/fill_nan_test.py similarity index 83% rename from tests/expr_and_series/fill_nan_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/fill_nan_test.py index 132b553c50..d021d79e95 100644 --- a/tests/expr_and_series/fill_nan_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/fill_nan_test.py @@ -1,22 +1,16 @@ from __future__ import annotations import pytest +from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.conftest import ( - dask_lazy_p1_constructor, - dask_lazy_p2_constructor, - modin_constructor, - pandas_constructor, -) -from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data -NON_NULLABLE_CONSTRUCTORS = [ - pandas_constructor, - dask_lazy_p1_constructor, - dask_lazy_p2_constructor, - modin_constructor, -] +NON_NULLABLE_CONSTRUCTOR_NAMES = { + "pandas_constructor", + "dask_lazy_p1_constructor", + "dask_lazy_p2_constructor", + "modin_constructor", +} def test_fill_nan(request: pytest.FixtureRequest, constructor: Constructor) -> None: @@ -36,7 +30,7 @@ def test_fill_nan(request: pytest.FixtureRequest, constructor: Constructor) -> N assert_equal_data(result, expected) assert result.lazy().collect()["float_na"].null_count() == 2 result = df.select(nw.all().fill_nan(3.0)) - if any(constructor is c for c in NON_NULLABLE_CONSTRUCTORS): + if constructor.__name__ in NON_NULLABLE_CONSTRUCTOR_NAMES: # no nan vs null distinction expected = {"float": [-1.0, 1.0, 3.0], "float_na": [3.0, 1.0, 3.0]} assert result.lazy().collect()["float_na"].null_count() == 0 @@ -55,7 +49,7 @@ def test_fill_nan_series(constructor_eager: ConstructorEager) -> None: "float_na" ] result = s.fill_nan(999) - if any(constructor_eager is c for c in NON_NULLABLE_CONSTRUCTORS): + if constructor_eager.__name__ in NON_NULLABLE_CONSTRUCTOR_NAMES: # no nan vs null distinction assert_equal_data({"a": result}, {"a": [999.0, 1.0, 999.0]}) elif "pandas" in str(constructor_eager) and PANDAS_VERSION >= (3,): diff --git a/tests/expr_and_series/fill_null_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/fill_null_test.py similarity index 100% rename from tests/expr_and_series/fill_null_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/fill_null_test.py index 213b695176..71f0d0e626 100644 --- a/tests/expr_and_series/fill_null_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/fill_null_test.py @@ -5,8 +5,6 @@ from typing import TYPE_CHECKING, Any import pytest - -import narwhals as nw from tests.utils import ( DASK_VERSION, DUCKDB_VERSION, @@ -16,6 +14,8 @@ assert_equal_data, ) +import narwhals as nw + if TYPE_CHECKING: from narwhals.typing import FillNullStrategy diff --git a/tests/expr_and_series/filter_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/filter_test.py similarity index 100% rename from tests/expr_and_series/filter_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/filter_test.py index 5f300ed4b8..b2dd1c02c7 100644 --- a/tests/expr_and_series/filter_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/filter_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data data = { "i": [0, 1, 2, 3, 4], diff --git a/tests/expr_and_series/first_last_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/first_last_test.py similarity index 99% rename from tests/expr_and_series/first_last_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/first_last_test.py index 0dab322cd1..3802df912b 100644 --- a/tests/expr_and_series/first_last_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/first_last_test.py @@ -4,9 +4,6 @@ from typing import TYPE_CHECKING import pytest - -import narwhals as nw -from narwhals.exceptions import InvalidOperationError from tests.utils import ( DUCKDB_VERSION, POLARS_VERSION, @@ -15,10 +12,14 @@ assert_equal_data, ) +import narwhals as nw +from narwhals.exceptions import InvalidOperationError + if TYPE_CHECKING: - from narwhals.typing import PythonLiteral from tests.utils import ConstructorEager + from narwhals.typing import PythonLiteral + data: dict[str, list[PythonLiteral]] = { "a": [8, 2, 1, None], "b": [58, 5, 6, 12], diff --git a/tests/expr_and_series/floor_ceil_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/floor_ceil_test.py similarity index 100% rename from tests/expr_and_series/floor_ceil_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/floor_ceil_test.py index ae0df72712..c41173931d 100644 --- a/tests/expr_and_series/floor_ceil_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/floor_ceil_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data def test_floor_expr(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/format_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/format_test.py similarity index 100% rename from tests/expr_and_series/format_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/format_test.py index 5bd4ba75a9..feccff446b 100644 --- a/tests/expr_and_series/format_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/format_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, assert_equal_data import narwhals as nw -from tests.utils import Constructor, assert_equal_data def test_format(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/horizontal_broadcasts_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/horizontal_broadcasts_test.py similarity index 100% rename from tests/expr_and_series/horizontal_broadcasts_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/horizontal_broadcasts_test.py index 6c6bb8966d..b11e4893f7 100644 --- a/tests/expr_and_series/horizontal_broadcasts_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/horizontal_broadcasts_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, Constructor, assert_equal_data def test_sumh_broadcasting(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/is_between_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_between_test.py similarity index 100% rename from tests/expr_and_series/is_between_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/is_between_test.py index 6cec08ad64..87017abbe7 100644 --- a/tests/expr_and_series/is_between_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_between_test.py @@ -4,10 +4,10 @@ from typing import Literal import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw from narwhals.exceptions import MultiOutputExpressionError -from tests.utils import Constructor, ConstructorEager, assert_equal_data @pytest.mark.parametrize( diff --git a/tests/expr_and_series/is_close_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_close_test.py similarity index 94% rename from tests/expr_and_series/is_close_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/is_close_test.py index a10e430402..74753655a9 100644 --- a/tests/expr_and_series/is_close_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_close_test.py @@ -9,26 +9,20 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw from narwhals.exceptions import ComputeError, InvalidOperationError -from tests.conftest import ( - dask_lazy_p1_constructor, - dask_lazy_p2_constructor, - modin_constructor, - pandas_constructor, -) -from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data if TYPE_CHECKING: from narwhals.typing import NumericLiteral -NON_NULLABLE_CONSTRUCTORS = ( - pandas_constructor, - dask_lazy_p1_constructor, - dask_lazy_p2_constructor, - modin_constructor, -) +NON_NULLABLE_CONSTRUCTOR_NAMES = { + "pandas_constructor", + "dask_lazy_p1_constructor", + "dask_lazy_p2_constructor", + "modin_constructor", +} NULL_PLACEHOLDER, NAN_PLACEHOLDER = 9999.0, -1.0 INF_POS, INF_NEG = float("inf"), float("-inf") @@ -120,7 +114,7 @@ def test_is_close_series_with_series( y = y.zip_with(y != NAN_PLACEHOLDER, y**0.5).zip_with(y != NULL_PLACEHOLDER, nulls) result = x.is_close(y, abs_tol=abs_tol, rel_tol=rel_tol, nans_equal=nans_equal) - if constructor_eager in NON_NULLABLE_CONSTRUCTORS: + if constructor_eager.__name__ in NON_NULLABLE_CONSTRUCTOR_NAMES: expected = [v if v is not None else nans_equal for v in expected] elif "pandas" in str(constructor_eager) and PANDAS_VERSION >= (3,): expected = [ @@ -148,7 +142,7 @@ def test_is_close_series_with_scalar( y = y.zip_with(y != NAN_PLACEHOLDER, y**0.5).zip_with(y != NULL_PLACEHOLDER, nulls) result = y.is_close(other, abs_tol=abs_tol, rel_tol=rel_tol, nans_equal=nans_equal) - if constructor_eager in NON_NULLABLE_CONSTRUCTORS: + if constructor_eager.__name__ in NON_NULLABLE_CONSTRUCTOR_NAMES: expected = [v if v is not None else False for v in expected] elif "pandas" in str(constructor_eager) and PANDAS_VERSION >= (3,): expected = [ @@ -193,7 +187,7 @@ def test_is_close_expr_with_expr( ) .sort("idx") ) - if constructor in NON_NULLABLE_CONSTRUCTORS: + if constructor.__name__ in NON_NULLABLE_CONSTRUCTOR_NAMES: expected = [v if v is not None else nans_equal for v in expected] elif "pandas" in str(constructor) and PANDAS_VERSION >= (3,): expected = [ @@ -234,7 +228,7 @@ def test_is_close_expr_with_scalar( ) .sort("idx") ) - if constructor in NON_NULLABLE_CONSTRUCTORS: + if constructor.__name__ in NON_NULLABLE_CONSTRUCTOR_NAMES: expected = [v if v is not None else False for v in expected] elif "pandas" in str(constructor) and PANDAS_VERSION >= (3,): expected = [ diff --git a/tests/expr_and_series/is_duplicated_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_duplicated_test.py similarity index 100% rename from tests/expr_and_series/is_duplicated_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/is_duplicated_test.py index 42f07a91e5..cbae76f407 100644 --- a/tests/expr_and_series/is_duplicated_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_duplicated_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data def test_is_duplicated_expr(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/is_finite_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_finite_test.py similarity index 89% rename from tests/expr_and_series/is_finite_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/is_finite_test.py index eb07b2a41e..58075be56f 100644 --- a/tests/expr_and_series/is_finite_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_finite_test.py @@ -3,22 +3,16 @@ from typing import Any import pytest +from tests.utils import POLARS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.conftest import ( - dask_lazy_p1_constructor, - dask_lazy_p2_constructor, - modin_constructor, - pandas_constructor, -) -from tests.utils import POLARS_VERSION, Constructor, ConstructorEager, assert_equal_data -NON_NULLABLE_CONSTRUCTORS = [ - pandas_constructor, - dask_lazy_p1_constructor, - dask_lazy_p2_constructor, - modin_constructor, -] +NON_NULLABLE_CONSTRUCTOR_NAMES = { + "pandas_constructor", + "dask_lazy_p1_constructor", + "dask_lazy_p2_constructor", + "modin_constructor", +} data = {"a": [float("nan"), float("inf"), 2.0, None]} @@ -77,7 +71,7 @@ def test_is_finite_column_with_null(constructor: Constructor, data: list[float]) result = df.select(nw.col("a").is_finite()) expected: dict[str, list[Any]] - if any(constructor is c for c in NON_NULLABLE_CONSTRUCTORS): + if constructor.__name__ in NON_NULLABLE_CONSTRUCTOR_NAMES: # Null values are coerced to NaN for non-nullable datatypes expected = {"a": [True, True, False]} else: diff --git a/tests/expr_and_series/is_first_distinct_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_first_distinct_test.py similarity index 100% rename from tests/expr_and_series/is_first_distinct_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/is_first_distinct_test.py index 6f0501b03c..a3c73589be 100644 --- a/tests/expr_and_series/is_first_distinct_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_first_distinct_test.py @@ -1,8 +1,6 @@ from __future__ import annotations import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, POLARS_VERSION, @@ -11,6 +9,8 @@ assert_equal_data, ) +import narwhals as nw + data = {"a": [1, 1, 2, 3, 2], "b": [1, 2, 3, 2, 1]} diff --git a/tests/expr_and_series/is_in_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_in_test.py similarity index 100% rename from tests/expr_and_series/is_in_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/is_in_test.py index 2ae6cabea5..92437975b1 100644 --- a/tests/expr_and_series/is_in_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_in_test.py @@ -3,9 +3,9 @@ import re import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = {"a": [1, 4, 2, 5]} diff --git a/tests/expr_and_series/is_last_distinct_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_last_distinct_test.py similarity index 100% rename from tests/expr_and_series/is_last_distinct_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/is_last_distinct_test.py index b4a96b5b9f..d9ab709adc 100644 --- a/tests/expr_and_series/is_last_distinct_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_last_distinct_test.py @@ -1,8 +1,6 @@ from __future__ import annotations import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, POLARS_VERSION, @@ -11,6 +9,8 @@ assert_equal_data, ) +import narwhals as nw + data = {"a": [1, 1, 2, 3, 2], "b": [1, 2, 3, 2, 1]} diff --git a/tests/expr_and_series/is_nan_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_nan_test.py similarity index 90% rename from tests/expr_and_series/is_nan_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/is_nan_test.py index 27790e27b2..cb0c806efa 100644 --- a/tests/expr_and_series/is_nan_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_nan_test.py @@ -3,22 +3,16 @@ from typing import Any import pytest +from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.conftest import ( - dask_lazy_p1_constructor, - dask_lazy_p2_constructor, - modin_constructor, - pandas_constructor, -) -from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data -NON_NULLABLE_CONSTRUCTORS = [ - pandas_constructor, - dask_lazy_p1_constructor, - dask_lazy_p2_constructor, - modin_constructor, -] +NON_NULLABLE_CONSTRUCTOR_NAMES = { + "pandas_constructor", + "dask_lazy_p1_constructor", + "dask_lazy_p2_constructor", + "modin_constructor", +} def test_nan(constructor: Constructor) -> None: @@ -33,7 +27,7 @@ def test_nan(constructor: Constructor) -> None: ) expected: dict[str, list[Any]] - if any(constructor is c for c in NON_NULLABLE_CONSTRUCTORS): + if constructor.__name__ in NON_NULLABLE_CONSTRUCTOR_NAMES: # Null values are coerced to NaN for non-nullable datatypes expected = { "int": [False, False, True], @@ -70,7 +64,7 @@ def test_nan_series(constructor_eager: ConstructorEager) -> None: "float_na": df["float_na"].is_nan(), } expected: dict[str, list[Any]] - if any(constructor_eager is c for c in NON_NULLABLE_CONSTRUCTORS): + if constructor_eager.__name__ in NON_NULLABLE_CONSTRUCTOR_NAMES: # Null values are coerced to NaN for non-nullable datatypes expected = { "int": [False, False, True], diff --git a/tests/expr_and_series/is_null_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_null_test.py similarity index 99% rename from tests/expr_and_series/is_null_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/is_null_test.py index 7542af4513..7cc0bccc7d 100644 --- a/tests/expr_and_series/is_null_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_null_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, ConstructorEager, assert_equal_data +import narwhals as nw + def test_null(constructor: Constructor) -> None: data_na = {"a": [None, 3, 2], "z": [7.0, None, None]} diff --git a/tests/expr_and_series/is_unique_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_unique_test.py similarity index 100% rename from tests/expr_and_series/is_unique_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/is_unique_test.py index 2df0518360..d9ab6d9369 100644 --- a/tests/expr_and_series/is_unique_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/is_unique_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data def test_is_unique_expr(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/kurtosis_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/kurtosis_test.py similarity index 100% rename from tests/expr_and_series/kurtosis_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/kurtosis_test.py index 55727445fe..84be925fc9 100644 --- a/tests/expr_and_series/kurtosis_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/kurtosis_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data @pytest.mark.parametrize( diff --git a/tests/expr_and_series/len_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/len_test.py similarity index 99% rename from tests/expr_and_series/len_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/len_test.py index 755c389a28..8b031f6c04 100644 --- a/tests/expr_and_series/len_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/len_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, ConstructorEager, assert_equal_data +import narwhals as nw + def test_len_no_filter(constructor: Constructor) -> None: data = {"a": list("xyz"), "b": [1, 2, None]} diff --git a/tests/expr_and_series/name/__init__.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/__init__.py similarity index 100% rename from tests/expr_and_series/name/__init__.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/list/__init__.py diff --git a/tests/expr_and_series/list/contains_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/contains_test.py similarity index 100% rename from tests/expr_and_series/list/contains_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/list/contains_test.py index 6e56846d6e..1dcdf12d7b 100644 --- a/tests/expr_and_series/list/contains_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/contains_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import assert_equal_data import narwhals as nw -from tests.utils import assert_equal_data if TYPE_CHECKING: from tests.utils import Constructor, ConstructorEager diff --git a/tests/expr_and_series/list/get_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/get_test.py similarity index 100% rename from tests/expr_and_series/list/get_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/list/get_test.py index 52ca3386ba..f7f273881e 100644 --- a/tests/expr_and_series/list/get_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/get_test.py @@ -4,9 +4,9 @@ from typing import Any import pytest +from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data data = {"a": [[1, 2], [None, 3], [None], None]} diff --git a/tests/expr_and_series/list/len_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/len_test.py similarity index 100% rename from tests/expr_and_series/list/len_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/list/len_test.py index 918fda5831..6fa1a794b6 100644 --- a/tests/expr_and_series/list/len_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/len_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data data = {"a": [[1, 2], [3, 4, None], None, [], [None]]} expected = {"a": [2, 3, None, 0, 1]} diff --git a/tests/expr_and_series/list/max_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/max_test.py similarity index 100% rename from tests/expr_and_series/list/max_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/list/max_test.py index 646bff2244..28cff6d4b8 100644 --- a/tests/expr_and_series/list/max_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/max_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import PANDAS_VERSION, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, assert_equal_data if TYPE_CHECKING: from tests.utils import Constructor, ConstructorEager diff --git a/tests/expr_and_series/list/mean_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/mean_test.py similarity index 100% rename from tests/expr_and_series/list/mean_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/list/mean_test.py index 9175d5b248..60356ad6bc 100644 --- a/tests/expr_and_series/list/mean_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/mean_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import PANDAS_VERSION, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, assert_equal_data if TYPE_CHECKING: from tests.utils import Constructor, ConstructorEager diff --git a/tests/expr_and_series/list/median_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/median_test.py similarity index 100% rename from tests/expr_and_series/list/median_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/list/median_test.py index f0d3c615ff..f688d088c3 100644 --- a/tests/expr_and_series/list/median_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/median_test.py @@ -4,9 +4,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import PANDAS_VERSION, POLARS_VERSION, assert_equal_data, is_windows import narwhals as nw -from tests.utils import PANDAS_VERSION, POLARS_VERSION, assert_equal_data, is_windows if TYPE_CHECKING: from tests.utils import Constructor, ConstructorEager diff --git a/tests/expr_and_series/list/min_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/min_test.py similarity index 100% rename from tests/expr_and_series/list/min_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/list/min_test.py index 2039f7de56..bf4fd4134f 100644 --- a/tests/expr_and_series/list/min_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/min_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import PANDAS_VERSION, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, assert_equal_data if TYPE_CHECKING: from tests.utils import Constructor, ConstructorEager diff --git a/tests/expr_and_series/list/sort_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/sort_test.py similarity index 100% rename from tests/expr_and_series/list/sort_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/list/sort_test.py index 1866934a73..d794be3a50 100644 --- a/tests/expr_and_series/list/sort_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/sort_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import PANDAS_VERSION, POLARS_VERSION, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, POLARS_VERSION, assert_equal_data if TYPE_CHECKING: from typing import Any diff --git a/tests/expr_and_series/list/sum_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/sum_test.py similarity index 100% rename from tests/expr_and_series/list/sum_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/list/sum_test.py index d66266e016..109c0544fc 100644 --- a/tests/expr_and_series/list/sum_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/sum_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import DUCKDB_VERSION, PANDAS_VERSION, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, PANDAS_VERSION, assert_equal_data if TYPE_CHECKING: from tests.utils import Constructor, ConstructorEager diff --git a/tests/expr_and_series/list/unique_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/unique_test.py similarity index 100% rename from tests/expr_and_series/list/unique_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/list/unique_test.py index 3d7c9dd039..44c0852952 100644 --- a/tests/expr_and_series/list/unique_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/list/unique_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import DUCKDB_VERSION import narwhals as nw -from tests.utils import DUCKDB_VERSION if TYPE_CHECKING: from tests.utils import Constructor, ConstructorEager diff --git a/tests/expr_and_series/lit_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/lit_test.py similarity index 100% rename from tests/expr_and_series/lit_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/lit_test.py index 188292c0d1..06947b68c1 100644 --- a/tests/expr_and_series/lit_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/lit_test.py @@ -4,8 +4,6 @@ from typing import TYPE_CHECKING, Any import pytest - -import narwhals as nw from tests.utils import ( CUDF_VERSION, DASK_VERSION, @@ -16,6 +14,8 @@ assert_equal_data, ) +import narwhals as nw + if TYPE_CHECKING: from narwhals.dtypes import DType from narwhals.typing import IntoDType, PythonLiteral diff --git a/tests/expr_and_series/log_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/log_test.py similarity index 100% rename from tests/expr_and_series/log_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/log_test.py index 4157b5a4a6..8e9d50c601 100644 --- a/tests/expr_and_series/log_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/log_test.py @@ -3,9 +3,9 @@ import math import pytest +from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data data = {"a": [-1, 0, 1, 2, 4]} diff --git a/tests/expr_and_series/map_batches_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/map_batches_test.py similarity index 99% rename from tests/expr_and_series/map_batches_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/map_batches_test.py index 4fd7e7e26b..92a30de377 100644 --- a/tests/expr_and_series/map_batches_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/map_batches_test.py @@ -6,7 +6,6 @@ pytest.importorskip("numpy") -import narwhals as nw from tests.utils import ( PANDAS_VERSION, POLARS_VERSION, @@ -14,6 +13,8 @@ assert_equal_data, ) +import narwhals as nw + if TYPE_CHECKING: from narwhals.dtypes import DType diff --git a/tests/expr_and_series/max_horizontal_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/max_horizontal_test.py similarity index 100% rename from tests/expr_and_series/max_horizontal_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/max_horizontal_test.py index cc0bddfb1a..08117f3655 100644 --- a/tests/expr_and_series/max_horizontal_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/max_horizontal_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, assert_equal_data import narwhals as nw -from tests.utils import Constructor, assert_equal_data data = {"a": [1, 3, None, None], "b": [4, None, 6, None], "z": [3, 1, None, None]} expected_values = [4, 3, 6, None] diff --git a/tests/expr_and_series/max_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/max_test.py similarity index 100% rename from tests/expr_and_series/max_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/max_test.py index eb359121c6..ebf61b75cc 100644 --- a/tests/expr_and_series/max_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/max_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/expr_and_series/mean_horizontal_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/mean_horizontal_test.py similarity index 100% rename from tests/expr_and_series/mean_horizontal_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/mean_horizontal_test.py index bc5bc12fa6..9eb7054cf7 100644 --- a/tests/expr_and_series/mean_horizontal_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/mean_horizontal_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, assert_equal_data import narwhals as nw -from tests.utils import Constructor, assert_equal_data def test_meanh(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/mean_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/mean_test.py similarity index 100% rename from tests/expr_and_series/mean_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/mean_test.py index 39a97bd53a..4a5114e08f 100644 --- a/tests/expr_and_series/mean_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/mean_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = {"a": [1, 3, 2], "b": [4, 4, 7], "z": [7.0, 8.0, 9.0]} diff --git a/tests/expr_and_series/median_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/median_test.py similarity index 100% rename from tests/expr_and_series/median_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/median_test.py index b01350586a..c964438253 100644 --- a/tests/expr_and_series/median_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/median_test.py @@ -3,10 +3,10 @@ import re import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw from narwhals.exceptions import InvalidOperationError -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = { "a": [3, 8, 2, None], diff --git a/tests/expr_and_series/min_horizontal_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/min_horizontal_test.py similarity index 100% rename from tests/expr_and_series/min_horizontal_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/min_horizontal_test.py index df9ff31feb..ef60488457 100644 --- a/tests/expr_and_series/min_horizontal_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/min_horizontal_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, assert_equal_data import narwhals as nw -from tests.utils import Constructor, assert_equal_data data = {"a": [1, 3, None, None], "b": [4, None, 6, None], "z": [3, 1, None, None]} expected_values = [1, 1, 6, None] diff --git a/tests/expr_and_series/min_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/min_test.py similarity index 100% rename from tests/expr_and_series/min_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/min_test.py index 842e70c166..40494d36bf 100644 --- a/tests/expr_and_series/min_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/min_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/expr_and_series/mode_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/mode_test.py similarity index 100% rename from tests/expr_and_series/mode_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/mode_test.py index a17de7bd17..12d7d513a4 100644 --- a/tests/expr_and_series/mode_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/mode_test.py @@ -5,10 +5,10 @@ from typing import Any import pytest +from tests.utils import POLARS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw from narwhals.exceptions import ShapeError -from tests.utils import POLARS_VERSION, Constructor, ConstructorEager, assert_equal_data data = {"a": [1, 1, 2, 2, 3], "b": [1, 2, 3, 3, 4]} data_group = { diff --git a/tests/expr_and_series/n_unique_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/n_unique_test.py similarity index 100% rename from tests/expr_and_series/n_unique_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/n_unique_test.py index e9af1f0154..a115f4bb42 100644 --- a/tests/expr_and_series/n_unique_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/n_unique_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data data = {"a": [1.0, None, None, 3.0], "b": [1.0, None, 4.0, 5.0]} diff --git a/tests/expr_and_series/str/__init__.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/__init__.py similarity index 100% rename from tests/expr_and_series/str/__init__.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/name/__init__.py diff --git a/tests/expr_and_series/name/keep_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/keep_test.py similarity index 99% rename from tests/expr_and_series/name/keep_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/name/keep_test.py index e4a3ba17f6..2183b341ce 100644 --- a/tests/expr_and_series/name/keep_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/keep_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, assert_equal_data +import narwhals as nw + data = {"foo": [1, 2, 3], "BAR": [4, 5, 6]} diff --git a/tests/expr_and_series/name/map_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/map_test.py similarity index 100% rename from tests/expr_and_series/name/map_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/name/map_test.py index eb4b2bc22b..b4088265aa 100644 --- a/tests/expr_and_series/name/map_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/map_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import POLARS_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import POLARS_VERSION, Constructor, assert_equal_data data = {"foo": [1, 2, 3], "BAR": [4, 5, 6]} diff --git a/tests/expr_and_series/name/prefix_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/prefix_test.py similarity index 100% rename from tests/expr_and_series/name/prefix_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/name/prefix_test.py index a639455823..a28d9100f9 100644 --- a/tests/expr_and_series/name/prefix_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/prefix_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import POLARS_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import POLARS_VERSION, Constructor, assert_equal_data data = {"foo": [1, 2, 3], "BAR": [4, 5, 6]} prefix = "with_prefix_" diff --git a/tests/expr_and_series/name/suffix_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/suffix_test.py similarity index 100% rename from tests/expr_and_series/name/suffix_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/name/suffix_test.py index 437d93e05a..eb32e73a15 100644 --- a/tests/expr_and_series/name/suffix_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/suffix_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import POLARS_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import POLARS_VERSION, Constructor, assert_equal_data data = {"foo": [1, 2, 3], "BAR": [4, 5, 6]} suffix = "_with_suffix" diff --git a/tests/expr_and_series/name/to_lowercase_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/to_lowercase_test.py similarity index 100% rename from tests/expr_and_series/name/to_lowercase_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/name/to_lowercase_test.py index 41a88a4f9c..c5a9dea29e 100644 --- a/tests/expr_and_series/name/to_lowercase_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/to_lowercase_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import POLARS_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import POLARS_VERSION, Constructor, assert_equal_data data = {"foo": [1, 2, 3], "BAR": [4, 5, 6]} diff --git a/tests/expr_and_series/name/to_uppercase_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/to_uppercase_test.py similarity index 100% rename from tests/expr_and_series/name/to_uppercase_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/name/to_uppercase_test.py index 9204ac86b5..cbc799ca7a 100644 --- a/tests/expr_and_series/name/to_uppercase_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/name/to_uppercase_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import POLARS_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import POLARS_VERSION, Constructor, assert_equal_data data = {"foo": [1, 2, 3], "BAR": [4, 5, 6]} diff --git a/tests/expr_and_series/nth_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/nth_test.py similarity index 100% rename from tests/expr_and_series/nth_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/nth_test.py index 1249f7f2e2..69a32a010c 100644 --- a/tests/expr_and_series/nth_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/nth_test.py @@ -4,9 +4,9 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import POLARS_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import POLARS_VERSION, Constructor, assert_equal_data if TYPE_CHECKING: from collections.abc import Mapping diff --git a/tests/expr_and_series/null_count_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/null_count_test.py similarity index 99% rename from tests/expr_and_series/null_count_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/null_count_test.py index 6efef0ada1..8294310cf1 100644 --- a/tests/expr_and_series/null_count_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/null_count_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, ConstructorEager, assert_equal_data +import narwhals as nw + data = {"a": [1.0, None, None, 3.0], "b": [1.0, None, 4.0, 5.0]} diff --git a/tests/expr_and_series/operators_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/operators_test.py similarity index 100% rename from tests/expr_and_series/operators_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/operators_test.py index f505c8f972..1aa2051986 100644 --- a/tests/expr_and_series/operators_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/operators_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DASK_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import DASK_VERSION, Constructor, ConstructorEager, assert_equal_data @pytest.mark.parametrize( diff --git a/tests/expr_and_series/order_dependent_lazy_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/order_dependent_lazy_test.py similarity index 100% rename from tests/expr_and_series/order_dependent_lazy_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/order_dependent_lazy_test.py diff --git a/tests/expr_and_series/over_pushdown_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/over_pushdown_test.py similarity index 100% rename from tests/expr_and_series/over_pushdown_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/over_pushdown_test.py index 8a8c9795d0..a45999f804 100644 --- a/tests/expr_and_series/over_pushdown_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/over_pushdown_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, Constructor, assert_equal_data def test_over_pushdown(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/over_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/over_test.py similarity index 100% rename from tests/expr_and_series/over_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/over_test.py index 7fbb8f0f9f..56abd0a088 100644 --- a/tests/expr_and_series/over_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/over_test.py @@ -3,9 +3,6 @@ from contextlib import nullcontext as does_not_raise import pytest - -import narwhals as nw -from narwhals.exceptions import InvalidOperationError from tests.utils import ( DUCKDB_VERSION, PANDAS_VERSION, @@ -15,6 +12,9 @@ assert_equal_data, ) +import narwhals as nw +from narwhals.exceptions import InvalidOperationError + data = { "a": ["a", "a", "b", "b", "b"], "b": [1, 2, 3, 5, 3], diff --git a/tests/expr_and_series/pipe_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/pipe_test.py similarity index 99% rename from tests/expr_and_series/pipe_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/pipe_test.py index d32743e1ea..0ef4743d2a 100644 --- a/tests/expr_and_series/pipe_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/pipe_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, ConstructorEager, assert_equal_data +import narwhals as nw + input_list = {"a": [2, 4, 6, 8]} expected = [4, 16, 36, 64] diff --git a/tests/expr_and_series/quantile_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/quantile_test.py similarity index 100% rename from tests/expr_and_series/quantile_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/quantile_test.py index 39489db89d..71c8f90e78 100644 --- a/tests/expr_and_series/quantile_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/quantile_test.py @@ -5,9 +5,9 @@ from typing import Literal import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data @pytest.mark.parametrize( diff --git a/tests/expr_and_series/rank_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/rank_test.py similarity index 100% rename from tests/expr_and_series/rank_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/rank_test.py index fb50fdeb59..f83e41570e 100644 --- a/tests/expr_and_series/rank_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/rank_test.py @@ -4,8 +4,6 @@ from typing import Literal import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, PANDAS_VERSION, @@ -16,6 +14,8 @@ is_windows, ) +import narwhals as nw + rank_methods = ["average", "min", "max", "dense", "ordinal"] data_int = {"a": [3, 6, 1, 1, None, 6], "b": [1, 1, 2, 1, 2, 2], "i": [1, 2, 3, 4, 5, 6]} diff --git a/tests/expr_and_series/reduction_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/reduction_test.py similarity index 100% rename from tests/expr_and_series/reduction_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/reduction_test.py index cba75767ea..d80e933516 100644 --- a/tests/expr_and_series/reduction_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/reduction_test.py @@ -4,9 +4,9 @@ from typing import Any import pytest +from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data @pytest.mark.parametrize( diff --git a/tests/expr_and_series/replace_strict_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/replace_strict_test.py similarity index 100% rename from tests/expr_and_series/replace_strict_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/replace_strict_test.py index 14bce078e1..7983f0f688 100644 --- a/tests/expr_and_series/replace_strict_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/replace_strict_test.py @@ -3,9 +3,6 @@ from typing import TYPE_CHECKING, Any import pytest - -import narwhals as nw -from narwhals.exceptions import InvalidOperationError from tests.utils import ( POLARS_VERSION, Constructor, @@ -14,6 +11,9 @@ xfail_if_pyspark_connect, ) +import narwhals as nw +from narwhals.exceptions import InvalidOperationError + if TYPE_CHECKING: from collections.abc import Mapping, Sequence diff --git a/tests/expr_and_series/rolling_mean_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/rolling_mean_test.py similarity index 100% rename from tests/expr_and_series/rolling_mean_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/rolling_mean_test.py index b4c0b9e656..6502fda948 100644 --- a/tests/expr_and_series/rolling_mean_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/rolling_mean_test.py @@ -6,8 +6,6 @@ import hypothesis.strategies as st import pytest from hypothesis import given - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, POLARS_VERSION, @@ -16,6 +14,8 @@ assert_equal_data, ) +import narwhals as nw + data = {"a": [None, 1, 2, None, 4, 6, 11]} kwargs_and_expected: dict[str, dict[str, Any]] = { diff --git a/tests/expr_and_series/rolling_std_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/rolling_std_test.py similarity index 100% rename from tests/expr_and_series/rolling_std_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/rolling_std_test.py index f027b450d9..6696e357b6 100644 --- a/tests/expr_and_series/rolling_std_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/rolling_std_test.py @@ -4,8 +4,6 @@ from typing import Any import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, PANDAS_VERSION, @@ -15,6 +13,8 @@ assert_equal_data, ) +import narwhals as nw + data = {"a": [1.0, 2.0, 1.0, 3.0, 1.0, 4.0, 1.0]} kwargs_and_expected = ( diff --git a/tests/expr_and_series/rolling_sum_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/rolling_sum_test.py similarity index 100% rename from tests/expr_and_series/rolling_sum_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/rolling_sum_test.py index df7b481826..87f77da82b 100644 --- a/tests/expr_and_series/rolling_sum_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/rolling_sum_test.py @@ -6,9 +6,6 @@ import hypothesis.strategies as st import pytest from hypothesis import given - -import narwhals as nw -from narwhals.exceptions import InvalidOperationError from tests.utils import ( DUCKDB_VERSION, PANDAS_VERSION, @@ -18,6 +15,9 @@ assert_equal_data, ) +import narwhals as nw +from narwhals.exceptions import InvalidOperationError + data = {"a": [None, 1, 2, None, 4, 6, 11]} kwargs_and_expected: dict[str, dict[str, Any]] = { diff --git a/tests/expr_and_series/rolling_var_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/rolling_var_test.py similarity index 100% rename from tests/expr_and_series/rolling_var_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/rolling_var_test.py index b38ba5f077..56857d05d2 100644 --- a/tests/expr_and_series/rolling_var_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/rolling_var_test.py @@ -6,8 +6,6 @@ import hypothesis.strategies as st import pytest from hypothesis import HealthCheck, given, settings - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, PANDAS_VERSION, @@ -17,6 +15,8 @@ assert_equal_data, ) +import narwhals as nw + pytest.importorskip("pandas") import pandas as pd diff --git a/tests/expr_and_series/round_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/round_test.py similarity index 100% rename from tests/expr_and_series/round_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/round_test.py index 0709ad28b7..4e2d7c00ad 100644 --- a/tests/expr_and_series/round_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/round_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data @pytest.mark.parametrize("decimals", [0, 1, 2]) diff --git a/tests/expr_and_series/sample_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/sample_test.py similarity index 99% rename from tests/expr_and_series/sample_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/sample_test.py index 4ec44a8712..e31ce67fcc 100644 --- a/tests/expr_and_series/sample_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/sample_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import ConstructorEager, assert_equal_data +import narwhals as nw + def test_sample_fraction(constructor_eager: ConstructorEager) -> None: df = nw.from_native( diff --git a/tests/expr_and_series/shift_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/shift_test.py similarity index 100% rename from tests/expr_and_series/shift_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/shift_test.py index a06ff4a872..bf1aca1ed7 100644 --- a/tests/expr_and_series/shift_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/shift_test.py @@ -4,8 +4,6 @@ from typing import Any import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, POLARS_VERSION, @@ -14,6 +12,8 @@ assert_equal_data, ) +import narwhals as nw + data = { "i": [0, 1, 2, 3, 4], "a": [0, 1, 2, 3, 4], diff --git a/tests/expr_and_series/sin_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/sin_test.py similarity index 100% rename from tests/expr_and_series/sin_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/sin_test.py index b1fed2f501..9ecfa8a59b 100644 --- a/tests/expr_and_series/sin_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/sin_test.py @@ -4,8 +4,6 @@ from typing import TYPE_CHECKING import pytest - -import narwhals as nw from tests.utils import ( PANDAS_VERSION, PYARROW_VERSION, @@ -14,6 +12,8 @@ assert_equal_data, ) +import narwhals as nw + if TYPE_CHECKING: from narwhals.typing import DTypeBackend diff --git a/tests/expr_and_series/skew_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/skew_test.py similarity index 100% rename from tests/expr_and_series/skew_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/skew_test.py index 6bfd8f0d68..b92dd1f4b3 100644 --- a/tests/expr_and_series/skew_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/skew_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data @pytest.mark.parametrize( diff --git a/tests/expr_and_series/sqrt_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/sqrt_test.py similarity index 100% rename from tests/expr_and_series/sqrt_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/sqrt_test.py index 057401d594..2032f98db3 100644 --- a/tests/expr_and_series/sqrt_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/sqrt_test.py @@ -3,8 +3,6 @@ from typing import TYPE_CHECKING import pytest - -import narwhals as nw from tests.utils import ( PANDAS_VERSION, PYARROW_VERSION, @@ -13,6 +11,8 @@ assert_equal_data, ) +import narwhals as nw + if TYPE_CHECKING: from narwhals.typing import DTypeBackend diff --git a/tests/expr_and_series/std_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/std_test.py similarity index 100% rename from tests/expr_and_series/std_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/std_test.py index d2b3cb14ef..e6afd11667 100644 --- a/tests/expr_and_series/std_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/std_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} data_with_nulls = {"a": [1, 3, 2, None], "b": [4, 4, 6, None], "z": [7.0, 8.0, 9.0, None]} diff --git a/tests/expr_and_series/struct_/__init__.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/__init__.py similarity index 100% rename from tests/expr_and_series/struct_/__init__.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/__init__.py diff --git a/tests/expr_and_series/str/contains_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/contains_test.py similarity index 100% rename from tests/expr_and_series/str/contains_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/contains_test.py index b61e27a335..5c875245de 100644 --- a/tests/expr_and_series/str/contains_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/contains_test.py @@ -3,9 +3,9 @@ from typing import Any import pytest +from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data data = {"pets": ["cat", "dog", "rabbit and parrot", "dove", "Parrot|dove", None]} diff --git a/tests/expr_and_series/str/head_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/head_test.py similarity index 99% rename from tests/expr_and_series/str/head_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/head_test.py index d6d09b978e..5daf025751 100644 --- a/tests/expr_and_series/str/head_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/head_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, ConstructorEager, assert_equal_data +import narwhals as nw + data = {"a": ["foo", "bars"]} diff --git a/tests/expr_and_series/str/len_chars_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/len_chars_test.py similarity index 99% rename from tests/expr_and_series/str/len_chars_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/len_chars_test.py index 32a726ab26..b3759a5c0a 100644 --- a/tests/expr_and_series/str/len_chars_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/len_chars_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, ConstructorEager, assert_equal_data +import narwhals as nw + data = {"a": ["foo", "foobar", "Café", "345", "東京"]} diff --git a/tests/expr_and_series/str/pad_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/pad_test.py similarity index 99% rename from tests/expr_and_series/str/pad_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/pad_test.py index 763fd41043..4a638369b8 100644 --- a/tests/expr_and_series/str/pad_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/pad_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, ConstructorEager, assert_equal_data +import narwhals as nw + def test_str_pad_start_series(constructor_eager: ConstructorEager) -> None: df = nw.from_native( diff --git a/tests/expr_and_series/str/replace_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/replace_test.py similarity index 100% rename from tests/expr_and_series/str/replace_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/replace_test.py index e6f49f409b..c6ec62c7e3 100644 --- a/tests/expr_and_series/str/replace_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/replace_test.py @@ -4,9 +4,9 @@ from typing import Any import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data replace_data = [ ({"a": ["123abc", "abc456"]}, r"abc\b", "ABC", 1, False, {"a": ["123ABC", "abc456"]}), diff --git a/tests/expr_and_series/str/slice_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/slice_test.py similarity index 100% rename from tests/expr_and_series/str/slice_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/slice_test.py index 87486e6927..440b5d72ac 100644 --- a/tests/expr_and_series/str/slice_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/slice_test.py @@ -3,9 +3,9 @@ from typing import Any import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = {"a": ["fdas", "edfas"]} diff --git a/tests/expr_and_series/str/split_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/split_test.py similarity index 100% rename from tests/expr_and_series/str/split_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/split_test.py index b6b25cd024..f2a6508e7c 100644 --- a/tests/expr_and_series/str/split_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/split_test.py @@ -4,9 +4,9 @@ from typing import Any import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = {"s": ["foo bar", "foo_bar", "foo_bar_baz", "foo,bar"]} diff --git a/tests/expr_and_series/str/starts_with_ends_with_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/starts_with_ends_with_test.py similarity index 100% rename from tests/expr_and_series/str/starts_with_ends_with_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/starts_with_ends_with_test.py index 73f60a355d..4d3c65cfa1 100644 --- a/tests/expr_and_series/str/starts_with_ends_with_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/starts_with_ends_with_test.py @@ -1,11 +1,11 @@ from __future__ import annotations -import narwhals as nw - # Don't move this into typechecking block, for coverage # purposes from tests.utils import Constructor, ConstructorEager, assert_equal_data +import narwhals as nw + data = {"a": ["fdas", "edfas"]} diff --git a/tests/expr_and_series/str/strip_chars_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/strip_chars_test.py similarity index 100% rename from tests/expr_and_series/str/strip_chars_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/strip_chars_test.py index 8944bce4de..881f8f4051 100644 --- a/tests/expr_and_series/str/strip_chars_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/strip_chars_test.py @@ -3,9 +3,9 @@ from typing import Any import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = {"a": ["foobar", "bar\n", " baz"]} diff --git a/tests/expr_and_series/str/tail_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/tail_test.py similarity index 99% rename from tests/expr_and_series/str/tail_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/tail_test.py index 8aa9d66c02..6eea00a6c6 100644 --- a/tests/expr_and_series/str/tail_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/tail_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, ConstructorEager, assert_equal_data +import narwhals as nw + data = {"a": ["foo", "bars"]} diff --git a/tests/expr_and_series/str/to_date_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/to_date_test.py similarity index 100% rename from tests/expr_and_series/str/to_date_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/to_date_test.py index d1f7558c9f..d252eb353e 100644 --- a/tests/expr_and_series/str/to_date_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/to_date_test.py @@ -4,9 +4,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import assert_equal_data, uses_pyarrow_backend import narwhals as nw -from tests.utils import assert_equal_data, uses_pyarrow_backend if TYPE_CHECKING: from tests.utils import Constructor, ConstructorEager diff --git a/tests/expr_and_series/str/to_datetime_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/to_datetime_test.py similarity index 100% rename from tests/expr_and_series/str/to_datetime_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/to_datetime_test.py index b98755a0cc..619266b398 100644 --- a/tests/expr_and_series/str/to_datetime_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/to_datetime_test.py @@ -6,9 +6,6 @@ from typing import TYPE_CHECKING, Any, Literal import pytest - -import narwhals as nw -from narwhals.exceptions import ComputeError from tests.utils import ( PANDAS_VERSION, POLARS_VERSION, @@ -17,6 +14,9 @@ is_windows, ) +import narwhals as nw +from narwhals.exceptions import ComputeError + if TYPE_CHECKING: from tests.utils import Constructor, ConstructorEager diff --git a/tests/expr_and_series/str/to_titlecase_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/to_titlecase_test.py similarity index 100% rename from tests/expr_and_series/str/to_titlecase_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/to_titlecase_test.py index ae61c3ecd2..38d96285ed 100644 --- a/tests/expr_and_series/str/to_titlecase_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/to_titlecase_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data data = { "a": [ diff --git a/tests/expr_and_series/str/to_uppercase_to_lowercase_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/to_uppercase_to_lowercase_test.py similarity index 100% rename from tests/expr_and_series/str/to_uppercase_to_lowercase_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/to_uppercase_to_lowercase_test.py index 7c5c39a481..a89d513560 100644 --- a/tests/expr_and_series/str/to_uppercase_to_lowercase_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/to_uppercase_to_lowercase_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data @pytest.mark.parametrize( diff --git a/tests/expr_and_series/str/zfill_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/zfill_test.py similarity index 100% rename from tests/expr_and_series/str/zfill_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/str/zfill_test.py index 78f59cecb1..c468bcdb49 100644 --- a/tests/expr_and_series/str/zfill_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/str/zfill_test.py @@ -1,8 +1,6 @@ from __future__ import annotations import pytest - -import narwhals as nw from tests.utils import ( PANDAS_VERSION, POLARS_VERSION, @@ -12,6 +10,8 @@ uses_pyarrow_backend, ) +import narwhals as nw + data = {"a": ["-1", "+1", "1", "12", "123", "99999", "+9999", None]} expected = {"a": ["-01", "+01", "001", "012", "123", "99999", "+9999", None]} diff --git a/tests/frame/__init__.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/struct_/__init__.py similarity index 100% rename from tests/frame/__init__.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/struct_/__init__.py diff --git a/tests/expr_and_series/struct_/field_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/struct_/field_test.py similarity index 100% rename from tests/expr_and_series/struct_/field_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/struct_/field_test.py index a351c31500..57d1bbdc70 100644 --- a/tests/expr_and_series/struct_/field_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/struct_/field_test.py @@ -3,9 +3,9 @@ from typing import cast import pytest +from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, Constructor, ConstructorEager, assert_equal_data def test_get_field_expr(request: pytest.FixtureRequest, constructor: Constructor) -> None: diff --git a/tests/expr_and_series/sum_horizontal_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/sum_horizontal_test.py similarity index 100% rename from tests/expr_and_series/sum_horizontal_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/sum_horizontal_test.py index 94cc32d4b0..a1e82a0986 100644 --- a/tests/expr_and_series/sum_horizontal_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/sum_horizontal_test.py @@ -3,9 +3,9 @@ from typing import Any import pytest +from tests.utils import DUCKDB_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, Constructor, assert_equal_data def test_sumh(constructor: Constructor) -> None: diff --git a/tests/expr_and_series/sum_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/sum_test.py similarity index 100% rename from tests/expr_and_series/sum_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/sum_test.py index 6501869a49..4b1fd88490 100644 --- a/tests/expr_and_series/sum_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/sum_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/expr_and_series/unary_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/unary_test.py similarity index 100% rename from tests/expr_and_series/unary_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/unary_test.py index 038136a902..74426005eb 100644 --- a/tests/expr_and_series/unary_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/unary_test.py @@ -3,9 +3,9 @@ from contextlib import nullcontext as does_not_raise import pytest +from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data def test_unary(constructor: Constructor, request: pytest.FixtureRequest) -> None: diff --git a/tests/expr_and_series/unique_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/unique_test.py similarity index 100% rename from tests/expr_and_series/unique_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/unique_test.py index c54a0356c7..d2e217f882 100644 --- a/tests/expr_and_series/unique_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/unique_test.py @@ -3,10 +3,10 @@ from contextlib import nullcontext as does_not_raise import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw from narwhals.exceptions import InvalidOperationError -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = {"a": [1, 1, None, 2]} data_str = {"a": ["x", "x", "y", None]} diff --git a/tests/expr_and_series/var_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/var_test.py similarity index 100% rename from tests/expr_and_series/var_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/var_test.py index f927dd1ac0..3a0c6425b1 100644 --- a/tests/expr_and_series/var_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/var_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} data_with_nulls = {"a": [1, 3, 2, None], "b": [4, 4, 6, None], "z": [7.0, 8.0, 9.0, None]} diff --git a/tests/expr_and_series/when_test.py b/narwhals-testing/narwhals_testing/tests/expr_and_series/when_test.py similarity index 100% rename from tests/expr_and_series/when_test.py rename to narwhals-testing/narwhals_testing/tests/expr_and_series/when_test.py index e279cb2830..525fd0612a 100644 --- a/tests/expr_and_series/when_test.py +++ b/narwhals-testing/narwhals_testing/tests/expr_and_series/when_test.py @@ -3,10 +3,10 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw from narwhals.exceptions import MultiOutputExpressionError -from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data if TYPE_CHECKING: from narwhals.typing import _1DArray diff --git a/tests/expression_parsing_test.py b/narwhals-testing/narwhals_testing/tests/expression_parsing_test.py similarity index 100% rename from tests/expression_parsing_test.py rename to narwhals-testing/narwhals_testing/tests/expression_parsing_test.py index 138063eb06..04c846db6e 100644 --- a/tests/expression_parsing_test.py +++ b/narwhals-testing/narwhals_testing/tests/expression_parsing_test.py @@ -1,10 +1,10 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION, POLARS_VERSION, Constructor, assert_equal_data import narwhals as nw from narwhals.exceptions import InvalidOperationError -from tests.utils import DUCKDB_VERSION, POLARS_VERSION, Constructor, assert_equal_data @pytest.mark.parametrize( diff --git a/tests/hypothesis/__init__.py b/narwhals-testing/narwhals_testing/tests/frame/__init__.py similarity index 100% rename from tests/hypothesis/__init__.py rename to narwhals-testing/narwhals_testing/tests/frame/__init__.py diff --git a/tests/frame/add_test.py b/narwhals-testing/narwhals_testing/tests/frame/add_test.py similarity index 100% rename from tests/frame/add_test.py rename to narwhals-testing/narwhals_testing/tests/frame/add_test.py index 166be83fd6..6a7a43263d 100644 --- a/tests/frame/add_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/add_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, Constructor, assert_equal_data def test_add(constructor: Constructor) -> None: diff --git a/tests/frame/array_dunder_test.py b/narwhals-testing/narwhals_testing/tests/frame/array_dunder_test.py similarity index 100% rename from tests/frame/array_dunder_test.py rename to narwhals-testing/narwhals_testing/tests/frame/array_dunder_test.py index d5db653c09..69b6554d42 100644 --- a/tests/frame/array_dunder_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/array_dunder_test.py @@ -4,8 +4,6 @@ pytest.importorskip("numpy") import numpy as np - -import narwhals as nw from tests.utils import ( PANDAS_VERSION, POLARS_VERSION, @@ -14,6 +12,8 @@ assert_equal_data, ) +import narwhals as nw + def test_array_dunder( request: pytest.FixtureRequest, constructor_eager: ConstructorEager diff --git a/tests/frame/arrow_c_stream_test.py b/narwhals-testing/narwhals_testing/tests/frame/arrow_c_stream_test.py similarity index 100% rename from tests/frame/arrow_c_stream_test.py rename to narwhals-testing/narwhals_testing/tests/frame/arrow_c_stream_test.py index 402cbd4fd5..fb8268fd18 100644 --- a/tests/frame/arrow_c_stream_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/arrow_c_stream_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import POLARS_VERSION, PYARROW_VERSION import narwhals as nw -from tests.utils import POLARS_VERSION, PYARROW_VERSION pytest.importorskip("polars") pytest.importorskip("pyarrow") diff --git a/tests/frame/clone_test.py b/narwhals-testing/narwhals_testing/tests/frame/clone_test.py similarity index 99% rename from tests/frame/clone_test.py rename to narwhals-testing/narwhals_testing/tests/frame/clone_test.py index 66b9771835..66dcee9002 100644 --- a/tests/frame/clone_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/clone_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import ConstructorEager, assert_equal_data +import narwhals as nw + def test_clone(constructor_eager: ConstructorEager) -> None: expected = {"a": [1, 2], "b": [3, 4]} diff --git a/tests/frame/collect_test.py b/narwhals-testing/narwhals_testing/tests/frame/collect_test.py similarity index 100% rename from tests/frame/collect_test.py rename to narwhals-testing/narwhals_testing/tests/frame/collect_test.py index 66ea38e979..e2b91e9c4a 100644 --- a/tests/frame/collect_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/collect_test.py @@ -3,11 +3,11 @@ from typing import TYPE_CHECKING, Any, Literal import pytest +from tests.utils import POLARS_VERSION, Constructor, assert_equal_data import narwhals as nw from narwhals._utils import Implementation from narwhals.dependencies import get_cudf, get_modin, get_polars -from tests.utils import POLARS_VERSION, Constructor, assert_equal_data if TYPE_CHECKING: from narwhals._typing import Arrow, Dask, IntoBackend, Modin, Pandas, Polars diff --git a/tests/frame/columns_test.py b/narwhals-testing/narwhals_testing/tests/frame/columns_test.py similarity index 100% rename from tests/frame/columns_test.py rename to narwhals-testing/narwhals_testing/tests/frame/columns_test.py index 3fda986219..debef1a7f1 100644 --- a/tests/frame/columns_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/columns_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import assert_equal_data import narwhals as nw -from tests.utils import assert_equal_data if TYPE_CHECKING: from tests.utils import Constructor, ConstructorEager diff --git a/tests/frame/concat_test.py b/narwhals-testing/narwhals_testing/tests/frame/concat_test.py similarity index 100% rename from tests/frame/concat_test.py rename to narwhals-testing/narwhals_testing/tests/frame/concat_test.py index 00beb2ebc1..6093f66c8c 100644 --- a/tests/frame/concat_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/concat_test.py @@ -5,11 +5,11 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import POLARS_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw from narwhals._utils import Implementation from narwhals.exceptions import InvalidOperationError, NarwhalsError -from tests.utils import POLARS_VERSION, Constructor, ConstructorEager, assert_equal_data if TYPE_CHECKING: from collections.abc import Iterator diff --git a/tests/frame/double_test.py b/narwhals-testing/narwhals_testing/tests/frame/double_test.py similarity index 99% rename from tests/frame/double_test.py rename to narwhals-testing/narwhals_testing/tests/frame/double_test.py index 6a8f5d6333..2d8c0bb39f 100644 --- a/tests/frame/double_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/double_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, assert_equal_data +import narwhals as nw + def test_double(constructor: Constructor) -> None: data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/frame/drop_nulls_test.py b/narwhals-testing/narwhals_testing/tests/frame/drop_nulls_test.py similarity index 100% rename from tests/frame/drop_nulls_test.py rename to narwhals-testing/narwhals_testing/tests/frame/drop_nulls_test.py index 34d433979d..c62adc7b66 100644 --- a/tests/frame/drop_nulls_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/drop_nulls_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, assert_equal_data import narwhals as nw -from tests.utils import Constructor, assert_equal_data data = {"alpha": [1.0, 2.0, None, 4.0], "beta gamma": [None, 3.0, None, 5.0]} diff --git a/tests/frame/drop_test.py b/narwhals-testing/narwhals_testing/tests/frame/drop_test.py similarity index 100% rename from tests/frame/drop_test.py rename to narwhals-testing/narwhals_testing/tests/frame/drop_test.py index 233ab3003b..ecd688d504 100644 --- a/tests/frame/drop_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/drop_test.py @@ -4,10 +4,10 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import POLARS_VERSION import narwhals as nw from narwhals.exceptions import ColumnNotFoundError -from tests.utils import POLARS_VERSION if TYPE_CHECKING: from tests.utils import Constructor diff --git a/tests/frame/eq_test.py b/narwhals-testing/narwhals_testing/tests/frame/eq_test.py similarity index 100% rename from tests/frame/eq_test.py rename to narwhals-testing/narwhals_testing/tests/frame/eq_test.py diff --git a/tests/frame/estimated_size_test.py b/narwhals-testing/narwhals_testing/tests/frame/estimated_size_test.py similarity index 100% rename from tests/frame/estimated_size_test.py rename to narwhals-testing/narwhals_testing/tests/frame/estimated_size_test.py diff --git a/tests/frame/explode_test.py b/narwhals-testing/narwhals_testing/tests/frame/explode_test.py similarity index 100% rename from tests/frame/explode_test.py rename to narwhals-testing/narwhals_testing/tests/frame/explode_test.py index 596eaa82a9..e016afcdc4 100644 --- a/tests/frame/explode_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/explode_test.py @@ -3,10 +3,10 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import PANDAS_VERSION, POLARS_VERSION, Constructor, assert_equal_data import narwhals as nw from narwhals.exceptions import InvalidOperationError, ShapeError -from tests.utils import PANDAS_VERSION, POLARS_VERSION, Constructor, assert_equal_data if TYPE_CHECKING: from collections.abc import Sequence diff --git a/tests/frame/filter_test.py b/narwhals-testing/narwhals_testing/tests/frame/filter_test.py similarity index 100% rename from tests/frame/filter_test.py rename to narwhals-testing/narwhals_testing/tests/frame/filter_test.py index f8048d8e4c..251792a1c9 100644 --- a/tests/frame/filter_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/filter_test.py @@ -3,10 +3,10 @@ from typing import Any import pytest +from tests.utils import Constructor, ConstructorEager, assert_equal_data import narwhals as nw from narwhals.exceptions import ColumnNotFoundError, InvalidOperationError -from tests.utils import Constructor, ConstructorEager, assert_equal_data data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/frame/from_arrow_test.py b/narwhals-testing/narwhals_testing/tests/frame/from_arrow_test.py similarity index 100% rename from tests/frame/from_arrow_test.py rename to narwhals-testing/narwhals_testing/tests/frame/from_arrow_test.py index a6f0203b62..283f0db370 100644 --- a/tests/frame/from_arrow_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/from_arrow_test.py @@ -7,10 +7,10 @@ pytest.importorskip("pyarrow") import pyarrow as pa +from tests.utils import PYARROW_VERSION, assert_equal_data import narwhals as nw from narwhals._utils import Implementation -from tests.utils import PYARROW_VERSION, assert_equal_data if TYPE_CHECKING: from narwhals._typing import EagerAllowed diff --git a/tests/frame/from_dict_test.py b/narwhals-testing/narwhals_testing/tests/frame/from_dict_test.py similarity index 100% rename from tests/frame/from_dict_test.py rename to narwhals-testing/narwhals_testing/tests/frame/from_dict_test.py index 4378d9820f..07023a8cc5 100644 --- a/tests/frame/from_dict_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/from_dict_test.py @@ -3,10 +3,10 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import Constructor, assert_equal_data import narwhals as nw from narwhals._utils import Implementation -from tests.utils import Constructor, assert_equal_data if TYPE_CHECKING: from narwhals._typing import EagerAllowed, Polars diff --git a/tests/frame/from_dicts_test.py b/narwhals-testing/narwhals_testing/tests/frame/from_dicts_test.py similarity index 100% rename from tests/frame/from_dicts_test.py rename to narwhals-testing/narwhals_testing/tests/frame/from_dicts_test.py index 3973e1eb0e..c528882d59 100644 --- a/tests/frame/from_dicts_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/from_dicts_test.py @@ -4,10 +4,10 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import assert_equal_data import narwhals as nw from narwhals._utils import qualified_type_name -from tests.utils import assert_equal_data if TYPE_CHECKING: from collections.abc import Callable, Mapping diff --git a/tests/frame/from_numpy_test.py b/narwhals-testing/narwhals_testing/tests/frame/from_numpy_test.py similarity index 100% rename from tests/frame/from_numpy_test.py rename to narwhals-testing/narwhals_testing/tests/frame/from_numpy_test.py index d586912d2e..6aa3ea850a 100644 --- a/tests/frame/from_numpy_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/from_numpy_test.py @@ -6,9 +6,9 @@ pytest.importorskip("numpy") import numpy as np +from tests.utils import assert_equal_data import narwhals as nw -from tests.utils import assert_equal_data if TYPE_CHECKING: from narwhals._typing import EagerAllowed diff --git a/tests/frame/get_column_test.py b/narwhals-testing/narwhals_testing/tests/frame/get_column_test.py similarity index 100% rename from tests/frame/get_column_test.py rename to narwhals-testing/narwhals_testing/tests/frame/get_column_test.py index 254dceffc8..c9b252b28a 100644 --- a/tests/frame/get_column_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/get_column_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data def test_get_column(constructor_eager: ConstructorEager) -> None: diff --git a/tests/frame/getitem_test.py b/narwhals-testing/narwhals_testing/tests/frame/getitem_test.py similarity index 100% rename from tests/frame/getitem_test.py rename to narwhals-testing/narwhals_testing/tests/frame/getitem_test.py index c079d154bb..a1c73d696b 100644 --- a/tests/frame/getitem_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/getitem_test.py @@ -4,9 +4,9 @@ from typing import TYPE_CHECKING, Any, cast import pytest +from tests.utils import PANDAS_VERSION, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, ConstructorEager, assert_equal_data if TYPE_CHECKING: from narwhals.typing import _1DArray diff --git a/tests/frame/group_by_test.py b/narwhals-testing/narwhals_testing/tests/frame/group_by_test.py similarity index 100% rename from tests/frame/group_by_test.py rename to narwhals-testing/narwhals_testing/tests/frame/group_by_test.py index 57aacae09b..46ee61812b 100644 --- a/tests/frame/group_by_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/group_by_test.py @@ -7,9 +7,6 @@ from typing import TYPE_CHECKING, Any import pytest - -import narwhals as nw -from narwhals.exceptions import DuplicateError, InvalidOperationError from tests.utils import ( DUCKDB_VERSION, PANDAS_VERSION, @@ -20,6 +17,9 @@ assert_equal_data, ) +import narwhals as nw +from narwhals.exceptions import DuplicateError, InvalidOperationError + if TYPE_CHECKING: from collections.abc import Mapping, Sequence diff --git a/tests/frame/head_test.py b/narwhals-testing/narwhals_testing/tests/frame/head_test.py similarity index 99% rename from tests/frame/head_test.py rename to narwhals-testing/narwhals_testing/tests/frame/head_test.py index 1c9aaf4123..818fa37766 100644 --- a/tests/frame/head_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/head_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, assert_equal_data +import narwhals as nw + def test_head(constructor: Constructor) -> None: data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/frame/interchange_native_namespace_test.py b/narwhals-testing/narwhals_testing/tests/frame/interchange_native_namespace_test.py similarity index 100% rename from tests/frame/interchange_native_namespace_test.py rename to narwhals-testing/narwhals_testing/tests/frame/interchange_native_namespace_test.py diff --git a/tests/frame/interchange_schema_test.py b/narwhals-testing/narwhals_testing/tests/frame/interchange_schema_test.py similarity index 100% rename from tests/frame/interchange_schema_test.py rename to narwhals-testing/narwhals_testing/tests/frame/interchange_schema_test.py index 9913c3bfcd..9ab43f2622 100644 --- a/tests/frame/interchange_schema_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/interchange_schema_test.py @@ -3,9 +3,9 @@ from datetime import date, datetime, timedelta import pytest +from tests.utils import IBIS_VERSION import narwhals.stable.v1 as nw_v1 -from tests.utils import IBIS_VERSION pytest.importorskip("polars") import polars as pl diff --git a/tests/frame/interchange_select_test.py b/narwhals-testing/narwhals_testing/tests/frame/interchange_select_test.py similarity index 100% rename from tests/frame/interchange_select_test.py rename to narwhals-testing/narwhals_testing/tests/frame/interchange_select_test.py diff --git a/tests/frame/interchange_to_arrow_test.py b/narwhals-testing/narwhals_testing/tests/frame/interchange_to_arrow_test.py similarity index 100% rename from tests/frame/interchange_to_arrow_test.py rename to narwhals-testing/narwhals_testing/tests/frame/interchange_to_arrow_test.py diff --git a/tests/frame/interchange_to_pandas_test.py b/narwhals-testing/narwhals_testing/tests/frame/interchange_to_pandas_test.py similarity index 100% rename from tests/frame/interchange_to_pandas_test.py rename to narwhals-testing/narwhals_testing/tests/frame/interchange_to_pandas_test.py index 254e712a51..a32d988e40 100644 --- a/tests/frame/interchange_to_pandas_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/interchange_to_pandas_test.py @@ -4,9 +4,9 @@ pytest.importorskip("pandas", minversion="1.5.0") import pandas as pd +from tests.utils import DUCKDB_VERSION, PANDAS_VERSION import narwhals.stable.v1 as nw_v1 -from tests.utils import DUCKDB_VERSION, PANDAS_VERSION data = {"a": [1, 2, 3], "b": [4.0, 5.0, 6.0], "z": ["x", "y", "z"]} diff --git a/tests/frame/invalid_test.py b/narwhals-testing/narwhals_testing/tests/frame/invalid_test.py similarity index 100% rename from tests/frame/invalid_test.py rename to narwhals-testing/narwhals_testing/tests/frame/invalid_test.py index d59b67adb1..6f925d6b47 100644 --- a/tests/frame/invalid_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/invalid_test.py @@ -3,10 +3,10 @@ from typing import TYPE_CHECKING, TypeVar import pytest +from tests.utils import NUMPY_VERSION, POLARS_VERSION, Constructor import narwhals as nw from narwhals.exceptions import MultiOutputExpressionError -from tests.utils import NUMPY_VERSION, POLARS_VERSION, Constructor T = TypeVar("T") diff --git a/tests/frame/is_duplicated_test.py b/narwhals-testing/narwhals_testing/tests/frame/is_duplicated_test.py similarity index 99% rename from tests/frame/is_duplicated_test.py rename to narwhals-testing/narwhals_testing/tests/frame/is_duplicated_test.py index 0703d2bd6c..d408ef6e00 100644 --- a/tests/frame/is_duplicated_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/is_duplicated_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import ConstructorEager, assert_equal_data +import narwhals as nw + def test_is_duplicated(constructor_eager: ConstructorEager) -> None: data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/frame/is_empty_test.py b/narwhals-testing/narwhals_testing/tests/frame/is_empty_test.py similarity index 100% rename from tests/frame/is_empty_test.py rename to narwhals-testing/narwhals_testing/tests/frame/is_empty_test.py diff --git a/tests/frame/is_unique_test.py b/narwhals-testing/narwhals_testing/tests/frame/is_unique_test.py similarity index 99% rename from tests/frame/is_unique_test.py rename to narwhals-testing/narwhals_testing/tests/frame/is_unique_test.py index 10e9af910d..af474cf857 100644 --- a/tests/frame/is_unique_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/is_unique_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import ConstructorEager, assert_equal_data +import narwhals as nw + def test_is_unique(constructor_eager: ConstructorEager) -> None: data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/frame/item_test.py b/narwhals-testing/narwhals_testing/tests/frame/item_test.py similarity index 100% rename from tests/frame/item_test.py rename to narwhals-testing/narwhals_testing/tests/frame/item_test.py index 997b91d847..960d3e6cc3 100644 --- a/tests/frame/item_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/item_test.py @@ -4,9 +4,9 @@ from typing import Any import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data @pytest.mark.parametrize(("row", "column", "expected"), [(0, 2, 7), (1, "z", 8)]) diff --git a/tests/frame/join_test.py b/narwhals-testing/narwhals_testing/tests/frame/join_test.py similarity index 100% rename from tests/frame/join_test.py rename to narwhals-testing/narwhals_testing/tests/frame/join_test.py index 2dcb662d96..c2d646ca68 100644 --- a/tests/frame/join_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/join_test.py @@ -5,8 +5,6 @@ from typing import TYPE_CHECKING, Any, Literal import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, PANDAS_VERSION, @@ -15,6 +13,8 @@ assert_equal_data, ) +import narwhals as nw + if TYPE_CHECKING: from narwhals.typing import IntoDataFrame, IntoLazyFrameT, JoinStrategy diff --git a/tests/frame/lazy_test.py b/narwhals-testing/narwhals_testing/tests/frame/lazy_test.py similarity index 99% rename from tests/frame/lazy_test.py rename to narwhals-testing/narwhals_testing/tests/frame/lazy_test.py index 9e671c68d2..4f016d2857 100644 --- a/tests/frame/lazy_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/lazy_test.py @@ -5,10 +5,6 @@ from typing import TYPE_CHECKING, Any import pytest - -import narwhals as nw -from narwhals._utils import Implementation -from narwhals.dependencies import get_cudf, get_modin from tests.utils import ( DUCKDB_VERSION, PANDAS_VERSION, @@ -17,10 +13,15 @@ sqlframe_session, ) +import narwhals as nw +from narwhals._utils import Implementation +from narwhals.dependencies import get_cudf, get_modin + if TYPE_CHECKING: - from narwhals._typing import LazyAllowed, SparkLike from tests.utils import ConstructorEager + from narwhals._typing import LazyAllowed, SparkLike + data = {"a": [1, 2, 3], "b": ["x", "y", "z"]} diff --git a/tests/frame/len_test.py b/narwhals-testing/narwhals_testing/tests/frame/len_test.py similarity index 100% rename from tests/frame/len_test.py rename to narwhals-testing/narwhals_testing/tests/frame/len_test.py diff --git a/tests/frame/null_count_test.py b/narwhals-testing/narwhals_testing/tests/frame/null_count_test.py similarity index 99% rename from tests/frame/null_count_test.py rename to narwhals-testing/narwhals_testing/tests/frame/null_count_test.py index eec6475c92..24b20de867 100644 --- a/tests/frame/null_count_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/null_count_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import ConstructorEager, assert_equal_data +import narwhals as nw + def test_null_count(constructor_eager: ConstructorEager) -> None: data = {"a": [None, 3, 2], "b": [4, 4, 6], "z": [7.0, None, 9]} diff --git a/tests/frame/pipe_test.py b/narwhals-testing/narwhals_testing/tests/frame/pipe_test.py similarity index 99% rename from tests/frame/pipe_test.py rename to narwhals-testing/narwhals_testing/tests/frame/pipe_test.py index 0a2eac992d..6be7f23267 100644 --- a/tests/frame/pipe_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/pipe_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, assert_equal_data +import narwhals as nw + data = {"a": ["foo", "bars"], "ab": ["foo", "bars"]} diff --git a/tests/frame/pivot_test.py b/narwhals-testing/narwhals_testing/tests/frame/pivot_test.py similarity index 100% rename from tests/frame/pivot_test.py rename to narwhals-testing/narwhals_testing/tests/frame/pivot_test.py index 260006555e..c543f40164 100644 --- a/tests/frame/pivot_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/pivot_test.py @@ -4,10 +4,10 @@ from typing import Any import pytest +from tests.utils import POLARS_VERSION, ConstructorEager, assert_equal_data import narwhals as nw from narwhals.exceptions import NarwhalsError -from tests.utils import POLARS_VERSION, ConstructorEager, assert_equal_data data = { "ix": [1, 2, 1, 1, 2, 2], diff --git a/tests/frame/reindex_test.py b/narwhals-testing/narwhals_testing/tests/frame/reindex_test.py similarity index 100% rename from tests/frame/reindex_test.py rename to narwhals-testing/narwhals_testing/tests/frame/reindex_test.py index 56a9d75262..52833af5e5 100644 --- a/tests/frame/reindex_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/reindex_test.py @@ -6,10 +6,10 @@ pytest.importorskip("pandas") import pandas as pd +from tests.utils import assert_equal_data import narwhals as nw from narwhals.exceptions import MultiOutputExpressionError -from tests.utils import assert_equal_data data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/frame/rename_test.py b/narwhals-testing/narwhals_testing/tests/frame/rename_test.py similarity index 99% rename from tests/frame/rename_test.py rename to narwhals-testing/narwhals_testing/tests/frame/rename_test.py index 11ec77185c..ada2455c63 100644 --- a/tests/frame/rename_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/rename_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import Constructor, assert_equal_data +import narwhals as nw + def test_rename(constructor: Constructor) -> None: data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/frame/row_test.py b/narwhals-testing/narwhals_testing/tests/frame/row_test.py similarity index 100% rename from tests/frame/row_test.py rename to narwhals-testing/narwhals_testing/tests/frame/row_test.py diff --git a/tests/frame/rows_test.py b/narwhals-testing/narwhals_testing/tests/frame/rows_test.py similarity index 100% rename from tests/frame/rows_test.py rename to narwhals-testing/narwhals_testing/tests/frame/rows_test.py index 95fd2d8094..23dad320b3 100644 --- a/tests/frame/rows_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/rows_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import is_pd_na import narwhals as nw -from tests.utils import is_pd_na if TYPE_CHECKING: from tests.utils import ConstructorEager diff --git a/tests/frame/sample_test.py b/narwhals-testing/narwhals_testing/tests/frame/sample_test.py similarity index 100% rename from tests/frame/sample_test.py rename to narwhals-testing/narwhals_testing/tests/frame/sample_test.py diff --git a/tests/frame/schema_test.py b/narwhals-testing/narwhals_testing/tests/frame/schema_test.py similarity index 100% rename from tests/frame/schema_test.py rename to narwhals-testing/narwhals_testing/tests/frame/schema_test.py index d90916b029..23b523d3b1 100644 --- a/tests/frame/schema_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/schema_test.py @@ -6,15 +6,16 @@ from typing import TYPE_CHECKING, Any, Literal import pytest +from tests.utils import PANDAS_VERSION, POLARS_VERSION, ConstructorPandasLike import narwhals as nw from narwhals.exceptions import PerformanceWarning -from tests.utils import PANDAS_VERSION, POLARS_VERSION, ConstructorPandasLike if TYPE_CHECKING: from collections.abc import Callable, Sequence import polars as pl + from tests.utils import Constructor, ConstructorEager from typing_extensions import TypeAlias from narwhals.typing import ( @@ -23,7 +24,6 @@ IntoPandasSchema, IntoPolarsSchema, ) - from tests.utils import Constructor, ConstructorEager TimeUnit: TypeAlias = Literal["ns", "us"] diff --git a/tests/frame/select_test.py b/narwhals-testing/narwhals_testing/tests/frame/select_test.py similarity index 100% rename from tests/frame/select_test.py rename to narwhals-testing/narwhals_testing/tests/frame/select_test.py index ad8bce44f8..5b73c4ab82 100644 --- a/tests/frame/select_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/select_test.py @@ -3,9 +3,6 @@ from typing import Any import pytest - -import narwhals as nw -from narwhals.exceptions import ColumnNotFoundError, InvalidIntoExprError, NarwhalsError from tests.utils import ( DASK_VERSION, DUCKDB_VERSION, @@ -15,6 +12,9 @@ maybe_collect, ) +import narwhals as nw +from narwhals.exceptions import ColumnNotFoundError, InvalidIntoExprError, NarwhalsError + class Foo: ... diff --git a/tests/frame/shape_test.py b/narwhals-testing/narwhals_testing/tests/frame/shape_test.py similarity index 100% rename from tests/frame/shape_test.py rename to narwhals-testing/narwhals_testing/tests/frame/shape_test.py diff --git a/tests/frame/sink_parquet_test.py b/narwhals-testing/narwhals_testing/tests/frame/sink_parquet_test.py similarity index 100% rename from tests/frame/sink_parquet_test.py rename to narwhals-testing/narwhals_testing/tests/frame/sink_parquet_test.py index 360828bded..5b7ec66809 100644 --- a/tests/frame/sink_parquet_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/sink_parquet_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import PANDAS_VERSION import narwhals as nw -from tests.utils import PANDAS_VERSION if TYPE_CHECKING: from tests.utils import Constructor diff --git a/tests/frame/sort_test.py b/narwhals-testing/narwhals_testing/tests/frame/sort_test.py similarity index 100% rename from tests/frame/sort_test.py rename to narwhals-testing/narwhals_testing/tests/frame/sort_test.py index 4539d90606..b5199fba69 100644 --- a/tests/frame/sort_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/sort_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, assert_equal_data import narwhals as nw -from tests.utils import Constructor, assert_equal_data def test_sort(constructor: Constructor) -> None: diff --git a/tests/frame/tail_test.py b/narwhals-testing/narwhals_testing/tests/frame/tail_test.py similarity index 99% rename from tests/frame/tail_test.py rename to narwhals-testing/narwhals_testing/tests/frame/tail_test.py index 4fdf4da8ef..7d17d3fc0b 100644 --- a/tests/frame/tail_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/tail_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import ConstructorEager, assert_equal_data +import narwhals as nw + def test_tail(constructor_eager: ConstructorEager) -> None: data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/frame/to_arrow_test.py b/narwhals-testing/narwhals_testing/tests/frame/to_arrow_test.py similarity index 100% rename from tests/frame/to_arrow_test.py rename to narwhals-testing/narwhals_testing/tests/frame/to_arrow_test.py diff --git a/tests/frame/to_dict_test.py b/narwhals-testing/narwhals_testing/tests/frame/to_dict_test.py similarity index 100% rename from tests/frame/to_dict_test.py rename to narwhals-testing/narwhals_testing/tests/frame/to_dict_test.py index c382a0619f..f6f35dce2b 100644 --- a/tests/frame/to_dict_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/to_dict_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data @pytest.mark.filterwarnings( diff --git a/tests/frame/to_native_test.py b/narwhals-testing/narwhals_testing/tests/frame/to_native_test.py similarity index 100% rename from tests/frame/to_native_test.py rename to narwhals-testing/narwhals_testing/tests/frame/to_native_test.py diff --git a/tests/frame/to_numpy_test.py b/narwhals-testing/narwhals_testing/tests/frame/to_numpy_test.py similarity index 100% rename from tests/frame/to_numpy_test.py rename to narwhals-testing/narwhals_testing/tests/frame/to_numpy_test.py index 9330a2c7b3..89ee11bcd8 100644 --- a/tests/frame/to_numpy_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/to_numpy_test.py @@ -7,9 +7,9 @@ pytest.importorskip("numpy") import numpy as np +from tests.utils import PANDAS_VERSION, is_windows import narwhals as nw -from tests.utils import PANDAS_VERSION, is_windows if TYPE_CHECKING: from tests.utils import ConstructorEager diff --git a/tests/frame/to_pandas_test.py b/narwhals-testing/narwhals_testing/tests/frame/to_pandas_test.py similarity index 100% rename from tests/frame/to_pandas_test.py rename to narwhals-testing/narwhals_testing/tests/frame/to_pandas_test.py index 473b685c19..04567ccbe0 100644 --- a/tests/frame/to_pandas_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/to_pandas_test.py @@ -6,9 +6,9 @@ pytest.importorskip("pandas") import pandas as pd +from tests.utils import PANDAS_VERSION import narwhals as nw -from tests.utils import PANDAS_VERSION if TYPE_CHECKING: from tests.utils import ConstructorEager diff --git a/tests/frame/to_polars_test.py b/narwhals-testing/narwhals_testing/tests/frame/to_polars_test.py similarity index 100% rename from tests/frame/to_polars_test.py rename to narwhals-testing/narwhals_testing/tests/frame/to_polars_test.py diff --git a/tests/frame/top_k_test.py b/narwhals-testing/narwhals_testing/tests/frame/top_k_test.py similarity index 100% rename from tests/frame/top_k_test.py rename to narwhals-testing/narwhals_testing/tests/frame/top_k_test.py index d0ba228df0..afff3b7718 100644 --- a/tests/frame/top_k_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/top_k_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION, POLARS_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import DUCKDB_VERSION, POLARS_VERSION, Constructor, assert_equal_data def test_top_k(constructor: Constructor) -> None: diff --git a/tests/frame/unique_test.py b/narwhals-testing/narwhals_testing/tests/frame/unique_test.py similarity index 100% rename from tests/frame/unique_test.py rename to narwhals-testing/narwhals_testing/tests/frame/unique_test.py index 691540d0a2..d72be7e06d 100644 --- a/tests/frame/unique_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/unique_test.py @@ -3,10 +3,10 @@ from typing import Literal import pytest +from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data import narwhals as nw from narwhals.exceptions import ColumnNotFoundError, InvalidOperationError -from tests.utils import DUCKDB_VERSION, Constructor, ConstructorEager, assert_equal_data data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/frame/unpivot_test.py b/narwhals-testing/narwhals_testing/tests/frame/unpivot_test.py similarity index 100% rename from tests/frame/unpivot_test.py rename to narwhals-testing/narwhals_testing/tests/frame/unpivot_test.py index 8d661ae1de..9f63e7af64 100644 --- a/tests/frame/unpivot_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/unpivot_test.py @@ -4,9 +4,9 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import PYARROW_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import PYARROW_VERSION, Constructor, assert_equal_data if TYPE_CHECKING: from narwhals.stable.v1.dtypes import DType diff --git a/tests/frame/with_columns_sequence_test.py b/narwhals-testing/narwhals_testing/tests/frame/with_columns_sequence_test.py similarity index 100% rename from tests/frame/with_columns_sequence_test.py rename to narwhals-testing/narwhals_testing/tests/frame/with_columns_sequence_test.py index 106f473886..ab8ecbf801 100644 --- a/tests/frame/with_columns_sequence_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/with_columns_sequence_test.py @@ -4,9 +4,9 @@ pytest.importorskip("numpy") import numpy as np +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data data = {"a": ["foo", "bars"], "ab": ["foo", "bars"]} diff --git a/tests/frame/with_columns_test.py b/narwhals-testing/narwhals_testing/tests/frame/with_columns_test.py similarity index 100% rename from tests/frame/with_columns_test.py rename to narwhals-testing/narwhals_testing/tests/frame/with_columns_test.py index e2325e9347..6f953548b5 100644 --- a/tests/frame/with_columns_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/with_columns_test.py @@ -1,9 +1,6 @@ from __future__ import annotations import pytest - -import narwhals as nw -from narwhals.exceptions import ColumnNotFoundError, ShapeError from tests.utils import ( PYARROW_VERSION, Constructor, @@ -12,6 +9,9 @@ maybe_collect, ) +import narwhals as nw +from narwhals.exceptions import ColumnNotFoundError, ShapeError + def test_with_columns_int_col_name_pandas() -> None: pytest.importorskip("pandas") diff --git a/tests/frame/with_row_index_test.py b/narwhals-testing/narwhals_testing/tests/frame/with_row_index_test.py similarity index 100% rename from tests/frame/with_row_index_test.py rename to narwhals-testing/narwhals_testing/tests/frame/with_row_index_test.py index 10310ca7f6..f1a07dc375 100644 --- a/tests/frame/with_row_index_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/with_row_index_test.py @@ -3,8 +3,6 @@ from typing import TYPE_CHECKING import pytest - -import narwhals as nw from tests.utils import ( DUCKDB_VERSION, PANDAS_VERSION, @@ -14,6 +12,8 @@ assert_equal_data, ) +import narwhals as nw + if TYPE_CHECKING: from collections.abc import Sequence diff --git a/tests/frame/write_csv_test.py b/narwhals-testing/narwhals_testing/tests/frame/write_csv_test.py similarity index 99% rename from tests/frame/write_csv_test.py rename to narwhals-testing/narwhals_testing/tests/frame/write_csv_test.py index 5f907ac78c..731d727e9a 100644 --- a/tests/frame/write_csv_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/write_csv_test.py @@ -2,9 +2,10 @@ from typing import TYPE_CHECKING -import narwhals as nw from tests.utils import ConstructorEager, is_windows +import narwhals as nw + if TYPE_CHECKING: import pytest diff --git a/tests/frame/write_parquet_test.py b/narwhals-testing/narwhals_testing/tests/frame/write_parquet_test.py similarity index 100% rename from tests/frame/write_parquet_test.py rename to narwhals-testing/narwhals_testing/tests/frame/write_parquet_test.py index cf86f1be00..b75b4498b5 100644 --- a/tests/frame/write_parquet_test.py +++ b/narwhals-testing/narwhals_testing/tests/frame/write_parquet_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import PANDAS_VERSION import narwhals as nw -from tests.utils import PANDAS_VERSION if TYPE_CHECKING: from tests.utils import ConstructorEager diff --git a/tests/from_dict_test.py b/narwhals-testing/narwhals_testing/tests/from_dict_test.py similarity index 100% rename from tests/from_dict_test.py rename to narwhals-testing/narwhals_testing/tests/from_dict_test.py index 93ea5b2880..20605e9124 100644 --- a/tests/from_dict_test.py +++ b/narwhals-testing/narwhals_testing/tests/from_dict_test.py @@ -3,11 +3,11 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import PYARROW_VERSION, Constructor, assert_equal_data import narwhals as nw from narwhals.exceptions import InvalidOperationError from narwhals.utils import Implementation -from tests.utils import PYARROW_VERSION, Constructor, assert_equal_data if TYPE_CHECKING: from narwhals._typing import EagerAllowed, Polars diff --git a/tests/from_dicts_test.py b/narwhals-testing/narwhals_testing/tests/from_dicts_test.py similarity index 100% rename from tests/from_dicts_test.py rename to narwhals-testing/narwhals_testing/tests/from_dicts_test.py index f6eb582c02..ad59ddef3f 100644 --- a/tests/from_dicts_test.py +++ b/narwhals-testing/narwhals_testing/tests/from_dicts_test.py @@ -4,10 +4,10 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import assert_equal_data import narwhals as nw from narwhals._utils import qualified_type_name -from tests.utils import assert_equal_data if TYPE_CHECKING: from collections.abc import Callable, Mapping diff --git a/tests/from_numpy_test.py b/narwhals-testing/narwhals_testing/tests/from_numpy_test.py similarity index 100% rename from tests/from_numpy_test.py rename to narwhals-testing/narwhals_testing/tests/from_numpy_test.py index e8ebcbc6f0..432f50f9d5 100644 --- a/tests/from_numpy_test.py +++ b/narwhals-testing/narwhals_testing/tests/from_numpy_test.py @@ -6,9 +6,9 @@ pytest.importorskip("numpy") import numpy as np +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data if TYPE_CHECKING: from narwhals.typing import _2DArray diff --git a/tests/from_pycapsule_test.py b/narwhals-testing/narwhals_testing/tests/from_pycapsule_test.py similarity index 100% rename from tests/from_pycapsule_test.py rename to narwhals-testing/narwhals_testing/tests/from_pycapsule_test.py index 4ca5087135..35d32570be 100644 --- a/tests/from_pycapsule_test.py +++ b/narwhals-testing/narwhals_testing/tests/from_pycapsule_test.py @@ -5,9 +5,9 @@ from typing import Any import pytest +from tests.utils import PYARROW_VERSION, assert_equal_data import narwhals as nw -from tests.utils import PYARROW_VERSION, assert_equal_data pytest.importorskip("pyarrow") import pyarrow as pa diff --git a/tests/get_dtype_backend_test.py b/narwhals-testing/narwhals_testing/tests/get_dtype_backend_test.py similarity index 100% rename from tests/get_dtype_backend_test.py rename to narwhals-testing/narwhals_testing/tests/get_dtype_backend_test.py diff --git a/tests/modern_polars/__init__.py b/narwhals-testing/narwhals_testing/tests/hypothesis/__init__.py similarity index 100% rename from tests/modern_polars/__init__.py rename to narwhals-testing/narwhals_testing/tests/hypothesis/__init__.py diff --git a/tests/hypothesis/getitem_test.py b/narwhals-testing/narwhals_testing/tests/hypothesis/getitem_test.py similarity index 97% rename from tests/hypothesis/getitem_test.py rename to narwhals-testing/narwhals_testing/tests/hypothesis/getitem_test.py index 759a292f97..d728fedcb0 100644 --- a/tests/hypothesis/getitem_test.py +++ b/narwhals-testing/narwhals_testing/tests/hypothesis/getitem_test.py @@ -5,11 +5,11 @@ import hypothesis.strategies as st import pytest from hypothesis import assume, given - -import narwhals as nw from tests.conftest import pandas_constructor, pyarrow_table_constructor from tests.utils import assert_equal_data +import narwhals as nw + if TYPE_CHECKING: from collections.abc import Sequence @@ -125,7 +125,7 @@ def test_getitem(pandas_or_pyarrow_constructor: Any, selector: Any) -> None: # NotImplementedError: Slicing with step is not supported on PyArrow tables assume( not ( - pandas_or_pyarrow_constructor is pyarrow_table_constructor + pandas_or_pyarrow_constructor.__name__ == "pyarrow_table_constructor" and isinstance(selector, slice) and selector.step is not None ) @@ -134,7 +134,7 @@ def test_getitem(pandas_or_pyarrow_constructor: Any, selector: Any) -> None: # NotImplementedError: Slicing with step is not supported on PyArrow tables assume( not ( - pandas_or_pyarrow_constructor is pyarrow_table_constructor + pandas_or_pyarrow_constructor.__name__ == "pyarrow_table_constructor" and isinstance(selector, tuple) and ( (isinstance(selector[0], slice) and selector[0].step is not None) diff --git a/tests/hypothesis/join_test.py b/narwhals-testing/narwhals_testing/tests/hypothesis/join_test.py similarity index 100% rename from tests/hypothesis/join_test.py rename to narwhals-testing/narwhals_testing/tests/hypothesis/join_test.py index 037854a861..fea77cd46c 100644 --- a/tests/hypothesis/join_test.py +++ b/narwhals-testing/narwhals_testing/tests/hypothesis/join_test.py @@ -4,9 +4,9 @@ import pytest from hypothesis import assume, given, strategies as st +from tests.utils import PANDAS_VERSION, POLARS_VERSION, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, POLARS_VERSION, assert_equal_data pytest.importorskip("pandas") pytest.importorskip("polars") diff --git a/tests/ibis_test.py b/narwhals-testing/narwhals_testing/tests/ibis_test.py similarity index 99% rename from tests/ibis_test.py rename to narwhals-testing/narwhals_testing/tests/ibis_test.py index 14a93c8ef8..c31631dc09 100644 --- a/tests/ibis_test.py +++ b/narwhals-testing/narwhals_testing/tests/ibis_test.py @@ -9,7 +9,6 @@ if TYPE_CHECKING: import ibis import polars as pl - from tests.utils import Constructor else: ibis = pytest.importorskip("ibis") diff --git a/tests/implementation_test.py b/narwhals-testing/narwhals_testing/tests/implementation_test.py similarity index 100% rename from tests/implementation_test.py rename to narwhals-testing/narwhals_testing/tests/implementation_test.py diff --git a/tests/joblib_test.py b/narwhals-testing/narwhals_testing/tests/joblib_test.py similarity index 100% rename from tests/joblib_test.py rename to narwhals-testing/narwhals_testing/tests/joblib_test.py index 72b9440544..854032f94f 100644 --- a/tests/joblib_test.py +++ b/narwhals-testing/narwhals_testing/tests/joblib_test.py @@ -3,9 +3,9 @@ from typing import Any import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data pytest.importorskip("joblib") diff --git a/tests/series_only/__init__.py b/narwhals-testing/narwhals_testing/tests/modern_polars/__init__.py similarity index 100% rename from tests/series_only/__init__.py rename to narwhals-testing/narwhals_testing/tests/modern_polars/__init__.py diff --git a/tests/modern_polars/ewm_mean_test.py b/narwhals-testing/narwhals_testing/tests/modern_polars/ewm_mean_test.py similarity index 100% rename from tests/modern_polars/ewm_mean_test.py rename to narwhals-testing/narwhals_testing/tests/modern_polars/ewm_mean_test.py index 0b3ea06923..bfeedf39d8 100644 --- a/tests/modern_polars/ewm_mean_test.py +++ b/narwhals-testing/narwhals_testing/tests/modern_polars/ewm_mean_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import POLARS_VERSION, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import POLARS_VERSION, ConstructorEager, assert_equal_data def test_ew_mean( diff --git a/tests/modern_polars/filter_test.py b/narwhals-testing/narwhals_testing/tests/modern_polars/filter_test.py similarity index 99% rename from tests/modern_polars/filter_test.py rename to narwhals-testing/narwhals_testing/tests/modern_polars/filter_test.py index a6a0664cf8..8c3c2a7632 100644 --- a/tests/modern_polars/filter_test.py +++ b/narwhals-testing/narwhals_testing/tests/modern_polars/filter_test.py @@ -2,9 +2,10 @@ from datetime import datetime -import narwhals as nw from tests.utils import Constructor, assert_equal_data +import narwhals as nw + def test_filter(constructor: Constructor) -> None: data = { diff --git a/tests/modern_polars/method_chaining_2_test.py b/narwhals-testing/narwhals_testing/tests/modern_polars/method_chaining_2_test.py similarity index 99% rename from tests/modern_polars/method_chaining_2_test.py rename to narwhals-testing/narwhals_testing/tests/modern_polars/method_chaining_2_test.py index 58451e9f9a..04bc288e08 100644 --- a/tests/modern_polars/method_chaining_2_test.py +++ b/narwhals-testing/narwhals_testing/tests/modern_polars/method_chaining_2_test.py @@ -2,9 +2,10 @@ from datetime import datetime -import narwhals as nw from tests.utils import Constructor, assert_equal_data +import narwhals as nw + data = { "flight_date": [ datetime(2022, 1, 14), diff --git a/tests/modern_polars/method_chaining_test.py b/narwhals-testing/narwhals_testing/tests/modern_polars/method_chaining_test.py similarity index 100% rename from tests/modern_polars/method_chaining_test.py rename to narwhals-testing/narwhals_testing/tests/modern_polars/method_chaining_test.py index 611f85973e..a187951fe1 100644 --- a/tests/modern_polars/method_chaining_test.py +++ b/narwhals-testing/narwhals_testing/tests/modern_polars/method_chaining_test.py @@ -3,9 +3,9 @@ import re import pytest +from tests.utils import PANDAS_VERSION, Constructor, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, Constructor, assert_equal_data data = { "OriginCityName": [ diff --git a/tests/modern_polars/performance_test.py b/narwhals-testing/narwhals_testing/tests/modern_polars/performance_test.py similarity index 100% rename from tests/modern_polars/performance_test.py rename to narwhals-testing/narwhals_testing/tests/modern_polars/performance_test.py index b765055cbd..da54612337 100644 --- a/tests/modern_polars/performance_test.py +++ b/narwhals-testing/narwhals_testing/tests/modern_polars/performance_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import Constructor, assert_equal_data import narwhals as nw -from tests.utils import Constructor, assert_equal_data data = {"weight": ["89kg", "83", "79kg", "68kg", "78kg", "73", "86kg"]} diff --git a/tests/modern_polars/pivot_test.py b/narwhals-testing/narwhals_testing/tests/modern_polars/pivot_test.py similarity index 100% rename from tests/modern_polars/pivot_test.py rename to narwhals-testing/narwhals_testing/tests/modern_polars/pivot_test.py index b6e6b16dde..3241e11f30 100644 --- a/tests/modern_polars/pivot_test.py +++ b/narwhals-testing/narwhals_testing/tests/modern_polars/pivot_test.py @@ -3,9 +3,9 @@ from datetime import datetime import pytest +from tests.utils import POLARS_VERSION, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import POLARS_VERSION, ConstructorEager, assert_equal_data def test_pivot( diff --git a/tests/modern_polars/unpivot_test.py b/narwhals-testing/narwhals_testing/tests/modern_polars/unpivot_test.py similarity index 99% rename from tests/modern_polars/unpivot_test.py rename to narwhals-testing/narwhals_testing/tests/modern_polars/unpivot_test.py index c5bff87dc6..887ee33efd 100644 --- a/tests/modern_polars/unpivot_test.py +++ b/narwhals-testing/narwhals_testing/tests/modern_polars/unpivot_test.py @@ -2,9 +2,10 @@ from datetime import datetime -import narwhals as nw from tests.utils import Constructor, assert_equal_data +import narwhals as nw + def test_unpivot(constructor: Constructor) -> None: data = { diff --git a/tests/namespace_test.py b/narwhals-testing/narwhals_testing/tests/namespace_test.py similarity index 100% rename from tests/namespace_test.py rename to narwhals-testing/narwhals_testing/tests/namespace_test.py index e94a6690c1..8a0d4ae281 100644 --- a/tests/namespace_test.py +++ b/narwhals-testing/narwhals_testing/tests/namespace_test.py @@ -12,6 +12,7 @@ from narwhals._utils import Version if TYPE_CHECKING: + from tests.utils import Constructor from typing_extensions import Never, TypeAlias, assert_type # noqa: F401 from narwhals._arrow.namespace import ArrowNamespace # noqa: F401 @@ -22,7 +23,6 @@ from narwhals._polars.namespace import PolarsNamespace # noqa: F401 from narwhals._typing import BackendName, _EagerAllowed from narwhals.typing import _2DArray - from tests.utils import Constructor ExprT = TypeVar("ExprT", bound="CompliantExprAny") diff --git a/tests/new_series_test.py b/narwhals-testing/narwhals_testing/tests/new_series_test.py similarity index 100% rename from tests/new_series_test.py rename to narwhals-testing/narwhals_testing/tests/new_series_test.py index 9360ef6fdc..3b7c05ebbf 100644 --- a/tests/new_series_test.py +++ b/narwhals-testing/narwhals_testing/tests/new_series_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data def test_new_series(constructor_eager: ConstructorEager) -> None: diff --git a/tests/no_imports_test.py b/narwhals-testing/narwhals_testing/tests/no_imports_test.py similarity index 100% rename from tests/no_imports_test.py rename to narwhals-testing/narwhals_testing/tests/no_imports_test.py diff --git a/tests/pickle_test.py b/narwhals-testing/narwhals_testing/tests/pickle_test.py similarity index 100% rename from tests/pickle_test.py rename to narwhals-testing/narwhals_testing/tests/pickle_test.py diff --git a/tests/plugins_test.py b/narwhals-testing/narwhals_testing/tests/plugins_test.py similarity index 100% rename from tests/plugins_test.py rename to narwhals-testing/narwhals_testing/tests/plugins_test.py diff --git a/tests/preserve_pandas_like_columns_name_attr_test.py b/narwhals-testing/narwhals_testing/tests/preserve_pandas_like_columns_name_attr_test.py similarity index 100% rename from tests/preserve_pandas_like_columns_name_attr_test.py rename to narwhals-testing/narwhals_testing/tests/preserve_pandas_like_columns_name_attr_test.py diff --git a/tests/read_scan_test.py b/narwhals-testing/narwhals_testing/tests/read_scan_test.py similarity index 100% rename from tests/read_scan_test.py rename to narwhals-testing/narwhals_testing/tests/read_scan_test.py index 4548f76a87..be0f0afd5b 100644 --- a/tests/read_scan_test.py +++ b/narwhals-testing/narwhals_testing/tests/read_scan_test.py @@ -4,8 +4,6 @@ from typing import TYPE_CHECKING, Any, Literal import pytest - -import narwhals as nw from tests.utils import ( PANDAS_VERSION, Constructor, @@ -14,6 +12,8 @@ sqlframe_session, ) +import narwhals as nw + pytest.importorskip("polars") pytest.importorskip("pyarrow") import polars as pl diff --git a/tests/repr_test.py b/narwhals-testing/narwhals_testing/tests/repr_test.py similarity index 100% rename from tests/repr_test.py rename to narwhals-testing/narwhals_testing/tests/repr_test.py index 7bf6034672..c2933bef90 100644 --- a/tests/repr_test.py +++ b/narwhals-testing/narwhals_testing/tests/repr_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION, PANDAS_VERSION import narwhals as nw -from tests.utils import DUCKDB_VERSION, PANDAS_VERSION def test_repr(request: pytest.FixtureRequest) -> None: diff --git a/tests/selectors_test.py b/narwhals-testing/narwhals_testing/tests/selectors_test.py similarity index 99% rename from tests/selectors_test.py rename to narwhals-testing/narwhals_testing/tests/selectors_test.py index 63c6b387e5..17ee8358cd 100644 --- a/tests/selectors_test.py +++ b/narwhals-testing/narwhals_testing/tests/selectors_test.py @@ -5,9 +5,6 @@ from typing import Literal import pytest - -import narwhals as nw -import narwhals.selectors as ncs from tests.utils import ( PANDAS_VERSION, POLARS_VERSION, @@ -17,6 +14,9 @@ is_windows, ) +import narwhals as nw +import narwhals.selectors as ncs + data = { "a": [1, 1, 2], "b": ["a", "b", "c"], @@ -268,7 +268,7 @@ def test_tz_aware(constructor: Constructor, request: pytest.FixtureRequest) -> N data = {"a": [datetime(2020, 1, 1), datetime(2020, 1, 2)], "c": [4, 5]} df = nw.from_native(constructor(data)).with_columns( - b=nw.col("a").dt.replace_time_zone("Asia/Katmandu") + b=nw.col("a").dt.replace_time_zone("Asia/Kathmandu") ) result = df.select(nw.selectors.by_dtype(nw.Datetime)).collect_schema().names() expected = ["a", "b"] diff --git a/tests/serde_test.py b/narwhals-testing/narwhals_testing/tests/serde_test.py similarity index 99% rename from tests/serde_test.py rename to narwhals-testing/narwhals_testing/tests/serde_test.py index dae845364f..abb548efd1 100644 --- a/tests/serde_test.py +++ b/narwhals-testing/narwhals_testing/tests/serde_test.py @@ -21,9 +21,10 @@ from narwhals.typing import IntoDType, NonNestedDType, TimeUnit if TYPE_CHECKING: - from narwhals.typing import DTypes from tests.utils import NestedOrEnumDType + from narwhals.typing import DTypes + IntoDTypeT = TypeVar("IntoDTypeT", bound=IntoDType) diff --git a/tests/series_only/__contains___test.py b/narwhals-testing/narwhals_testing/tests/series_only/__contains___test.py similarity index 100% rename from tests/series_only/__contains___test.py rename to narwhals-testing/narwhals_testing/tests/series_only/__contains___test.py diff --git a/tests/testing/__init__.py b/narwhals-testing/narwhals_testing/tests/series_only/__init__.py similarity index 100% rename from tests/testing/__init__.py rename to narwhals-testing/narwhals_testing/tests/series_only/__init__.py diff --git a/tests/series_only/__iter___test.py b/narwhals-testing/narwhals_testing/tests/series_only/__iter___test.py similarity index 100% rename from tests/series_only/__iter___test.py rename to narwhals-testing/narwhals_testing/tests/series_only/__iter___test.py index 5ed9e083f9..91c3f67098 100644 --- a/tests/series_only/__iter___test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/__iter___test.py @@ -4,9 +4,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import assert_equal_data import narwhals as nw -from tests.utils import assert_equal_data if TYPE_CHECKING: from tests.utils import ConstructorEager diff --git a/tests/series_only/alias_rename_test.py b/narwhals-testing/narwhals_testing/tests/series_only/alias_rename_test.py similarity index 99% rename from tests/series_only/alias_rename_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/alias_rename_test.py index e8420e8089..4adebf6ed8 100644 --- a/tests/series_only/alias_rename_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/alias_rename_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import ConstructorEager, assert_equal_data +import narwhals as nw + def test_alias_rename(constructor_eager: ConstructorEager) -> None: data = [1, 2, 3] diff --git a/tests/series_only/arg_max_test.py b/narwhals-testing/narwhals_testing/tests/series_only/arg_max_test.py similarity index 100% rename from tests/series_only/arg_max_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/arg_max_test.py index c6460b7183..ea47ef9184 100644 --- a/tests/series_only/arg_max_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/arg_max_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0], "i": [3, 1, 5]} diff --git a/tests/series_only/arg_min_test.py b/narwhals-testing/narwhals_testing/tests/series_only/arg_min_test.py similarity index 100% rename from tests/series_only/arg_min_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/arg_min_test.py index 34a38a57f9..a979c20831 100644 --- a/tests/series_only/arg_min_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/arg_min_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8.0, 9.0]} diff --git a/tests/series_only/arg_true_test.py b/narwhals-testing/narwhals_testing/tests/series_only/arg_true_test.py similarity index 99% rename from tests/series_only/arg_true_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/arg_true_test.py index ccc25a83e7..1c6d5ba70e 100644 --- a/tests/series_only/arg_true_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/arg_true_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import ConstructorEager, assert_equal_data +import narwhals as nw + def test_arg_true_series(constructor_eager: ConstructorEager) -> None: df = nw.from_native(constructor_eager({"a": [1, None, None, 3]}), eager_only=True) diff --git a/tests/series_only/array_dunder_test.py b/narwhals-testing/narwhals_testing/tests/series_only/array_dunder_test.py similarity index 100% rename from tests/series_only/array_dunder_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/array_dunder_test.py index b50d033aa2..262e74b2cf 100644 --- a/tests/series_only/array_dunder_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/array_dunder_test.py @@ -4,8 +4,6 @@ pytest.importorskip("numpy") import numpy as np - -import narwhals as nw from tests.utils import ( PANDAS_VERSION, PYARROW_VERSION, @@ -13,6 +11,8 @@ assert_equal_data, ) +import narwhals as nw + def test_array_dunder( request: pytest.FixtureRequest, constructor_eager: ConstructorEager diff --git a/tests/series_only/arrow_c_stream_test.py b/narwhals-testing/narwhals_testing/tests/series_only/arrow_c_stream_test.py similarity index 100% rename from tests/series_only/arrow_c_stream_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/arrow_c_stream_test.py index 98d54d7b0c..b85f51eeef 100644 --- a/tests/series_only/arrow_c_stream_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/arrow_c_stream_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import POLARS_VERSION, PYARROW_VERSION import narwhals as nw -from tests.utils import POLARS_VERSION, PYARROW_VERSION pytest.importorskip("polars") pytest.importorskip("pyarrow") diff --git a/tests/series_only/cast_test.py b/narwhals-testing/narwhals_testing/tests/series_only/cast_test.py similarity index 100% rename from tests/series_only/cast_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/cast_test.py index b646f38299..c29c650a1a 100644 --- a/tests/series_only/cast_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/cast_test.py @@ -4,9 +4,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import PANDAS_VERSION import narwhals as nw -from tests.utils import PANDAS_VERSION if TYPE_CHECKING: from tests.utils import Constructor, ConstructorEager diff --git a/tests/series_only/from_iterable_test.py b/narwhals-testing/narwhals_testing/tests/series_only/from_iterable_test.py similarity index 100% rename from tests/series_only/from_iterable_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/from_iterable_test.py index 4daac24ea8..1f3846bc80 100644 --- a/tests/series_only/from_iterable_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/from_iterable_test.py @@ -5,10 +5,10 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import PANDAS_VERSION, assert_equal_series import narwhals as nw from narwhals._utils import qualified_type_name -from tests.utils import PANDAS_VERSION, assert_equal_series if TYPE_CHECKING: from collections.abc import ( diff --git a/tests/series_only/from_numpy_test.py b/narwhals-testing/narwhals_testing/tests/series_only/from_numpy_test.py similarity index 100% rename from tests/series_only/from_numpy_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/from_numpy_test.py index 809ca4f00a..036984b2db 100644 --- a/tests/series_only/from_numpy_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/from_numpy_test.py @@ -7,9 +7,9 @@ pytest.importorskip("numpy") import numpy as np +from tests.utils import assert_equal_series import narwhals as nw -from tests.utils import assert_equal_series if TYPE_CHECKING: from collections.abc import Sequence diff --git a/tests/series_only/gather_every_test.py b/narwhals-testing/narwhals_testing/tests/series_only/gather_every_test.py similarity index 100% rename from tests/series_only/gather_every_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/gather_every_test.py index e7d55fb03c..76c4a3267f 100644 --- a/tests/series_only/gather_every_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/gather_every_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data data = {"a": list(range(10))} diff --git a/tests/series_only/getitem_test.py b/narwhals-testing/narwhals_testing/tests/series_only/getitem_test.py similarity index 100% rename from tests/series_only/getitem_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/getitem_test.py index aa63ac8414..839bc55205 100644 --- a/tests/series_only/getitem_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/getitem_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING import pytest +from tests.utils import assert_equal_data, assert_equal_series import narwhals as nw -from tests.utils import assert_equal_data, assert_equal_series if TYPE_CHECKING: from tests.utils import ConstructorEager diff --git a/tests/series_only/head_test.py b/narwhals-testing/narwhals_testing/tests/series_only/head_test.py similarity index 100% rename from tests/series_only/head_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/head_test.py index 5697bc59e5..555f3a09c4 100644 --- a/tests/series_only/head_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/head_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data @pytest.mark.parametrize("n", [2, -1]) diff --git a/tests/series_only/hist_test.py b/narwhals-testing/narwhals_testing/tests/series_only/hist_test.py similarity index 100% rename from tests/series_only/hist_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/hist_test.py index 183c0a13ff..40c4044452 100644 --- a/tests/series_only/hist_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/hist_test.py @@ -8,10 +8,10 @@ import hypothesis.strategies as st import pytest from hypothesis import given +from tests.utils import POLARS_VERSION, ConstructorEager, assert_equal_data import narwhals as nw from narwhals.exceptions import ComputeError -from tests.utils import POLARS_VERSION, ConstructorEager, assert_equal_data if TYPE_CHECKING: from collections.abc import Sequence diff --git a/tests/series_only/is_empty_test.py b/narwhals-testing/narwhals_testing/tests/series_only/is_empty_test.py similarity index 100% rename from tests/series_only/is_empty_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/is_empty_test.py diff --git a/tests/series_only/is_ordered_categorical_test.py b/narwhals-testing/narwhals_testing/tests/series_only/is_ordered_categorical_test.py similarity index 100% rename from tests/series_only/is_ordered_categorical_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/is_ordered_categorical_test.py index 8833957b1c..1aaac050c9 100644 --- a/tests/series_only/is_ordered_categorical_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/is_ordered_categorical_test.py @@ -3,10 +3,10 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import POLARS_VERSION import narwhals as nw from narwhals._utils import Implementation, Version -from tests.utils import POLARS_VERSION if TYPE_CHECKING: from tests.utils import ConstructorEager diff --git a/tests/series_only/is_sorted_test.py b/narwhals-testing/narwhals_testing/tests/series_only/is_sorted_test.py similarity index 100% rename from tests/series_only/is_sorted_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/is_sorted_test.py index 046669aac0..2b29f713aa 100644 --- a/tests/series_only/is_sorted_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/is_sorted_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data data = [1, 3, 2] data_dups = [4, 4, 6] diff --git a/tests/series_only/item_test.py b/narwhals-testing/narwhals_testing/tests/series_only/item_test.py similarity index 100% rename from tests/series_only/item_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/item_test.py index 521ce5af55..89c28f2c7f 100644 --- a/tests/series_only/item_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/item_test.py @@ -3,9 +3,9 @@ import re import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data data = [1, 3, 2] diff --git a/tests/series_only/scatter_test.py b/narwhals-testing/narwhals_testing/tests/series_only/scatter_test.py similarity index 100% rename from tests/series_only/scatter_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/scatter_test.py index 4b827276b9..5d950f9777 100644 --- a/tests/series_only/scatter_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/scatter_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data def test_scatter(constructor_eager: ConstructorEager) -> None: diff --git a/tests/series_only/shape_test.py b/narwhals-testing/narwhals_testing/tests/series_only/shape_test.py similarity index 100% rename from tests/series_only/shape_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/shape_test.py diff --git a/tests/series_only/sort_test.py b/narwhals-testing/narwhals_testing/tests/series_only/sort_test.py similarity index 100% rename from tests/series_only/sort_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/sort_test.py index 8b74c6623b..36acf0749c 100644 --- a/tests/series_only/sort_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/sort_test.py @@ -3,9 +3,9 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import assert_equal_data import narwhals as nw -from tests.utils import assert_equal_data if TYPE_CHECKING: from tests.utils import ConstructorEager diff --git a/tests/series_only/tail_test.py b/narwhals-testing/narwhals_testing/tests/series_only/tail_test.py similarity index 100% rename from tests/series_only/tail_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/tail_test.py index 43f9866094..32e27c289c 100644 --- a/tests/series_only/tail_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/tail_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data @pytest.mark.parametrize("n", [2, -1]) diff --git a/tests/series_only/to_arrow_test.py b/narwhals-testing/narwhals_testing/tests/series_only/to_arrow_test.py similarity index 100% rename from tests/series_only/to_arrow_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/to_arrow_test.py diff --git a/tests/series_only/to_dummy_test.py b/narwhals-testing/narwhals_testing/tests/series_only/to_dummy_test.py similarity index 100% rename from tests/series_only/to_dummy_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/to_dummy_test.py index df301a6978..c53fd2e323 100644 --- a/tests/series_only/to_dummy_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/to_dummy_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import ConstructorEager, assert_equal_data data = ["x", "y", "z"] data_na = ["x", "y", None] diff --git a/tests/series_only/to_frame_test.py b/narwhals-testing/narwhals_testing/tests/series_only/to_frame_test.py similarity index 99% rename from tests/series_only/to_frame_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/to_frame_test.py index 8f56f7f6fa..6ee1b43c04 100644 --- a/tests/series_only/to_frame_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/to_frame_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import ConstructorEager, assert_equal_data +import narwhals as nw + data = [1, 2, 3] diff --git a/tests/series_only/to_list_test.py b/narwhals-testing/narwhals_testing/tests/series_only/to_list_test.py similarity index 99% rename from tests/series_only/to_list_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/to_list_test.py index e532f54799..4a42f70a36 100644 --- a/tests/series_only/to_list_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/to_list_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import ConstructorEager, assert_equal_data +import narwhals as nw + data = [1, 2, 3] diff --git a/tests/series_only/to_native_test.py b/narwhals-testing/narwhals_testing/tests/series_only/to_native_test.py similarity index 100% rename from tests/series_only/to_native_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/to_native_test.py diff --git a/tests/series_only/to_numpy_test.py b/narwhals-testing/narwhals_testing/tests/series_only/to_numpy_test.py similarity index 100% rename from tests/series_only/to_numpy_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/to_numpy_test.py index 21873760cb..0b35a7e458 100644 --- a/tests/series_only/to_numpy_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/to_numpy_test.py @@ -8,9 +8,9 @@ pytest.importorskip("numpy") import numpy as np from numpy.testing import assert_array_equal +from tests.utils import PANDAS_VERSION, is_windows import narwhals as nw -from tests.utils import PANDAS_VERSION, is_windows if TYPE_CHECKING: from tests.utils import ConstructorEager diff --git a/tests/series_only/to_pandas_test.py b/narwhals-testing/narwhals_testing/tests/series_only/to_pandas_test.py similarity index 100% rename from tests/series_only/to_pandas_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/to_pandas_test.py index 95cd969f14..6751c95e36 100644 --- a/tests/series_only/to_pandas_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/to_pandas_test.py @@ -7,9 +7,9 @@ pytest.importorskip("pandas") import pandas as pd from pandas.testing import assert_series_equal +from tests.utils import PANDAS_VERSION import narwhals as nw -from tests.utils import PANDAS_VERSION if TYPE_CHECKING: from tests.utils import ConstructorEager diff --git a/tests/series_only/to_polars_test.py b/narwhals-testing/narwhals_testing/tests/series_only/to_polars_test.py similarity index 100% rename from tests/series_only/to_polars_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/to_polars_test.py diff --git a/tests/series_only/value_counts_test.py b/narwhals-testing/narwhals_testing/tests/series_only/value_counts_test.py similarity index 100% rename from tests/series_only/value_counts_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/value_counts_test.py index 77a7656cf2..54b4545035 100644 --- a/tests/series_only/value_counts_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/value_counts_test.py @@ -3,9 +3,9 @@ from typing import Any import pytest +from tests.utils import PANDAS_VERSION, ConstructorEager, assert_equal_data import narwhals as nw -from tests.utils import PANDAS_VERSION, ConstructorEager, assert_equal_data data = [4, 4, 4, 1, 6, 6, 4, 4, 1, 1] diff --git a/tests/series_only/zip_with_test.py b/narwhals-testing/narwhals_testing/tests/series_only/zip_with_test.py similarity index 99% rename from tests/series_only/zip_with_test.py rename to narwhals-testing/narwhals_testing/tests/series_only/zip_with_test.py index b40ac19fd6..165ad9a610 100644 --- a/tests/series_only/zip_with_test.py +++ b/narwhals-testing/narwhals_testing/tests/series_only/zip_with_test.py @@ -1,8 +1,9 @@ from __future__ import annotations -import narwhals as nw from tests.utils import ConstructorEager, assert_equal_data +import narwhals as nw + def test_zip_with(constructor_eager: ConstructorEager) -> None: series1 = nw.from_native(constructor_eager({"a": [1, 3, 2]}), eager_only=True)["a"] diff --git a/tests/sql_test.py b/narwhals-testing/narwhals_testing/tests/sql_test.py similarity index 100% rename from tests/sql_test.py rename to narwhals-testing/narwhals_testing/tests/sql_test.py index 1f9db2728d..40ec14c3eb 100644 --- a/tests/sql_test.py +++ b/narwhals-testing/narwhals_testing/tests/sql_test.py @@ -1,9 +1,9 @@ from __future__ import annotations import pytest +from tests.utils import DUCKDB_VERSION import narwhals as nw -from tests.utils import DUCKDB_VERSION def test_sql() -> None: diff --git a/tests/stable_api_test.py b/narwhals-testing/narwhals_testing/tests/stable_api_test.py similarity index 100% rename from tests/stable_api_test.py rename to narwhals-testing/narwhals_testing/tests/stable_api_test.py diff --git a/tests/stable_v1_dependencies_test.py b/narwhals-testing/narwhals_testing/tests/stable_v1_dependencies_test.py similarity index 100% rename from tests/stable_v1_dependencies_test.py rename to narwhals-testing/narwhals_testing/tests/stable_v1_dependencies_test.py diff --git a/tests/system_info_test.py b/narwhals-testing/narwhals_testing/tests/system_info_test.py similarity index 100% rename from tests/system_info_test.py rename to narwhals-testing/narwhals_testing/tests/system_info_test.py diff --git a/tests/translate/__init__.py b/narwhals-testing/narwhals_testing/tests/testing/__init__.py similarity index 100% rename from tests/translate/__init__.py rename to narwhals-testing/narwhals_testing/tests/testing/__init__.py diff --git a/tests/testing/assert_frame_equal_test.py b/narwhals-testing/narwhals_testing/tests/testing/assert_frame_equal_test.py similarity index 99% rename from tests/testing/assert_frame_equal_test.py rename to narwhals-testing/narwhals_testing/tests/testing/assert_frame_equal_test.py index c1b3b4e357..c2acfa9bd6 100644 --- a/tests/testing/assert_frame_equal_test.py +++ b/narwhals-testing/narwhals_testing/tests/testing/assert_frame_equal_test.py @@ -5,17 +5,18 @@ from typing import TYPE_CHECKING, Any import pytest +from tests.utils import PANDAS_VERSION import narwhals as nw from narwhals.testing import assert_frame_equal from narwhals.testing.asserts.frame import GUARANTEES_ROW_ORDER -from tests.utils import PANDAS_VERSION if TYPE_CHECKING: - from narwhals.typing import IntoSchema from tests.conftest import Data from tests.utils import Constructor, ConstructorEager + from narwhals.typing import IntoSchema + def _assertion_error(detail: str) -> pytest.RaisesExc: msg = f"DataFrames are different ({detail})" diff --git a/tests/testing/assert_series_equal_test.py b/narwhals-testing/narwhals_testing/tests/testing/assert_series_equal_test.py similarity index 100% rename from tests/testing/assert_series_equal_test.py rename to narwhals-testing/narwhals_testing/tests/testing/assert_series_equal_test.py index c4826c695e..865bd3100a 100644 --- a/tests/testing/assert_series_equal_test.py +++ b/narwhals-testing/narwhals_testing/tests/testing/assert_series_equal_test.py @@ -5,17 +5,17 @@ from typing import TYPE_CHECKING, Any, Callable import pytest +from tests.utils import PANDAS_VERSION, POLARS_VERSION, PYARROW_VERSION import narwhals as nw from narwhals.testing import assert_series_equal -from tests.utils import PANDAS_VERSION, POLARS_VERSION, PYARROW_VERSION if TYPE_CHECKING: + from tests.conftest import Data + from tests.utils import ConstructorEager from typing_extensions import TypeAlias from narwhals.typing import IntoSchema, IntoSeriesT - from tests.conftest import Data - from tests.utils import ConstructorEager SetupFn: TypeAlias = Callable[[nw.Series[Any]], tuple[nw.Series[Any], nw.Series[Any]]] diff --git a/tests/testing/conftest.py b/narwhals-testing/narwhals_testing/tests/testing/conftest.py similarity index 99% rename from tests/testing/conftest.py rename to narwhals-testing/narwhals_testing/tests/testing/conftest.py index a41d4fdce4..942d98d311 100644 --- a/tests/testing/conftest.py +++ b/narwhals-testing/narwhals_testing/tests/testing/conftest.py @@ -8,9 +8,10 @@ import narwhals as nw if TYPE_CHECKING: - from narwhals.typing import IntoSchema from tests.conftest import Data + from narwhals.typing import IntoSchema + @pytest.fixture(scope="module") def testing_schema() -> IntoSchema: diff --git a/tests/tpch_q1_test.py b/narwhals-testing/narwhals_testing/tests/tpch_q1_test.py similarity index 100% rename from tests/tpch_q1_test.py rename to narwhals-testing/narwhals_testing/tests/tpch_q1_test.py index 4424ce3c37..de2330d433 100644 --- a/tests/tpch_q1_test.py +++ b/narwhals-testing/narwhals_testing/tests/tpch_q1_test.py @@ -7,9 +7,9 @@ from unittest import mock import pytest +from tests.utils import DASK_VERSION, PANDAS_VERSION, assert_equal_data import narwhals as nw -from tests.utils import DASK_VERSION, PANDAS_VERSION, assert_equal_data if TYPE_CHECKING: from narwhals.typing import IntoFrame diff --git a/narwhals-testing/narwhals_testing/tests/translate/__init__.py b/narwhals-testing/narwhals_testing/tests/translate/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/translate/from_native_test.py b/narwhals-testing/narwhals_testing/tests/translate/from_native_test.py similarity index 100% rename from tests/translate/from_native_test.py rename to narwhals-testing/narwhals_testing/tests/translate/from_native_test.py index daa626dafe..fb25cc80ed 100644 --- a/tests/translate/from_native_test.py +++ b/narwhals-testing/narwhals_testing/tests/translate/from_native_test.py @@ -27,11 +27,11 @@ from typing import TYPE_CHECKING, Any, Literal, cast import pytest +from tests.conftest import sqlframe_pyspark_lazy_constructor +from tests.utils import Constructor, maybe_get_modin_df import narwhals as nw from narwhals._utils import Version -from tests.conftest import sqlframe_pyspark_lazy_constructor -from tests.utils import Constructor, maybe_get_modin_df if TYPE_CHECKING: from collections.abc import Iterable, Iterator diff --git a/tests/translate/get_native_namespace_test.py b/narwhals-testing/narwhals_testing/tests/translate/get_native_namespace_test.py similarity index 100% rename from tests/translate/get_native_namespace_test.py rename to narwhals-testing/narwhals_testing/tests/translate/get_native_namespace_test.py diff --git a/tests/translate/narwhalify_test.py b/narwhals-testing/narwhals_testing/tests/translate/narwhalify_test.py similarity index 100% rename from tests/translate/narwhalify_test.py rename to narwhals-testing/narwhals_testing/tests/translate/narwhalify_test.py diff --git a/tests/translate/to_native_test.py b/narwhals-testing/narwhals_testing/tests/translate/to_native_test.py similarity index 100% rename from tests/translate/to_native_test.py rename to narwhals-testing/narwhals_testing/tests/translate/to_native_test.py diff --git a/tests/translate/to_py_scalar_test.py b/narwhals-testing/narwhals_testing/tests/translate/to_py_scalar_test.py similarity index 100% rename from tests/translate/to_py_scalar_test.py rename to narwhals-testing/narwhals_testing/tests/translate/to_py_scalar_test.py diff --git a/tests/typing_compat_test.py b/narwhals-testing/narwhals_testing/tests/typing_compat_test.py similarity index 100% rename from tests/typing_compat_test.py rename to narwhals-testing/narwhals_testing/tests/typing_compat_test.py diff --git a/tests/utils.py b/narwhals-testing/narwhals_testing/tests/utils.py similarity index 100% rename from tests/utils.py rename to narwhals-testing/narwhals_testing/tests/utils.py diff --git a/tests/utils_test.py b/narwhals-testing/narwhals_testing/tests/utils_test.py similarity index 100% rename from tests/utils_test.py rename to narwhals-testing/narwhals_testing/tests/utils_test.py index b0336e8a04..5c87f11582 100644 --- a/tests/utils_test.py +++ b/narwhals-testing/narwhals_testing/tests/utils_test.py @@ -9,6 +9,7 @@ import hypothesis.strategies as st import pytest from hypothesis import given +from tests.utils import get_module_version_as_tuple import narwhals as nw from narwhals._utils import ( @@ -19,7 +20,6 @@ parse_version, requires, ) -from tests.utils import get_module_version_as_tuple pytest.importorskip("pandas") import pandas as pd diff --git a/tests/v1_test.py b/narwhals-testing/narwhals_testing/tests/v1_test.py similarity index 100% rename from tests/v1_test.py rename to narwhals-testing/narwhals_testing/tests/v1_test.py index 330211162f..a0e7505664 100644 --- a/tests/v1_test.py +++ b/narwhals-testing/narwhals_testing/tests/v1_test.py @@ -8,6 +8,17 @@ from typing import TYPE_CHECKING, Any, Callable, cast import pytest +from tests.utils import ( + DUCKDB_VERSION, + PANDAS_VERSION, + POLARS_VERSION, + PYARROW_VERSION, + Constructor, + ConstructorEager, + assert_equal_data, + assert_equal_hash, + assert_equal_series, +) import narwhals as nw import narwhals.stable.v1 as nw_v1 @@ -31,28 +42,17 @@ is_pyarrow_table, ) from narwhals.utils import Version -from tests.utils import ( - DUCKDB_VERSION, - PANDAS_VERSION, - POLARS_VERSION, - PYARROW_VERSION, - Constructor, - ConstructorEager, - assert_equal_data, - assert_equal_hash, - assert_equal_series, -) if TYPE_CHECKING: from collections.abc import Sequence + from tests.utils import Constructor, ConstructorEager from typing_extensions import assert_type from narwhals._typing import EagerAllowed from narwhals.dtypes import DType from narwhals.stable.v1.typing import IntoDataFrameT from narwhals.typing import IntoDType, _1DArray, _2DArray - from tests.utils import Constructor, ConstructorEager def test_toplevel() -> None: diff --git a/tests/v2_test.py b/narwhals-testing/narwhals_testing/tests/v2_test.py similarity index 100% rename from tests/v2_test.py rename to narwhals-testing/narwhals_testing/tests/v2_test.py index e423449fb5..7b4d0adc4c 100644 --- a/tests/v2_test.py +++ b/narwhals-testing/narwhals_testing/tests/v2_test.py @@ -8,12 +8,6 @@ from typing import TYPE_CHECKING, Any, cast import pytest - -import narwhals as nw -import narwhals.stable.v2 as nw_v2 -from narwhals._utils import Implementation -from narwhals.exceptions import NarwhalsUnstableWarning, ShapeError -from narwhals.utils import Version from tests.utils import ( PANDAS_VERSION, POLARS_VERSION, @@ -24,6 +18,12 @@ assert_equal_series, ) +import narwhals as nw +import narwhals.stable.v2 as nw_v2 +from narwhals._utils import Implementation +from narwhals.exceptions import NarwhalsUnstableWarning, ShapeError +from narwhals.utils import Version + if TYPE_CHECKING: from collections.abc import Sequence diff --git a/tests/version_test.py b/narwhals-testing/narwhals_testing/tests/version_test.py similarity index 100% rename from tests/version_test.py rename to narwhals-testing/narwhals_testing/tests/version_test.py diff --git a/narwhals-testing/pyproject.toml b/narwhals-testing/pyproject.toml new file mode 100644 index 0000000000..15fc8d7b68 --- /dev/null +++ b/narwhals-testing/pyproject.toml @@ -0,0 +1,20 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "narwhals-testing" +version = "0.1.0" +description = "Narwhals test suite for plugin authors" +requires-python = ">=3.9" +license = {text = "MIT"} +dependencies = [ + "narwhals>=2.16.0", + "pytest>=7.0.0", +] + +[project.entry-points.pytest11] +narwhals-testing = "narwhals_testing._plugin" + +[tool.hatch.build.targets.wheel] +packages = ["narwhals_testing"] diff --git a/noxfile.py b/noxfile.py index 134232d0b4..77798a7653 100644 --- a/noxfile.py +++ b/noxfile.py @@ -21,11 +21,12 @@ def run_common(session: Session, coverage_threshold: float) -> None: else: session.install("-e .[dask,modin,pyspark,ibis] --group dev-core --group extra") + session.install("-e", "narwhals-testing/.") session.run( "pytest", - "tests", + "narwhals-testing/narwhals_testing/tests", "--cov=narwhals", - "--cov=tests", + "--cov=narwhals-testing/narwhals_testing/tests", f"--cov-fail-under={coverage_threshold}", "--runslow", ) diff --git a/pyproject.toml b/pyproject.toml index 77fa69df5a..218b7c1783 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "hatchling.build" name = "narwhals" version = "2.16.0" dependencies = [] -requires-python = ">=3.9" +requires-python = ">=3.10" authors = [ { name = "Marco Gorelli", email = "hello_narwhals@proton.me" }, ] @@ -42,7 +42,7 @@ Repository = "https://github.com/narwhals-dev/narwhals" # `modin.pandas.__version__`. The latter is the one that we make # API decisions based on, so that's the one we track internally. # We have yet to determine the minimum Modin version we support -# https://github.com/narwhals-dev/narwhals/issues/817 +# https://github.com/narwhals-dev/narwhals/issues/817 pandas = ["pandas>=1.1.3"] modin = ["modin"] cudf = ["cudf-cu12>=24.10.0"] @@ -59,9 +59,10 @@ sql = ["duckdb>=1.1", "sqlparse"] [dependency-groups] core = [ "narwhals[duckdb,pandas,polars,pyarrow,sqlframe,sql]" -] +] tests = [ "covdefaults", + "narwhals-testing", "pytest", "pytest-cov", "pytest-env", @@ -129,7 +130,6 @@ local-dev = [ [tool.hatch.build.targets.sdist] include = [ "narwhals/*", - "tests/*", ] [tool.hatch.build.targets.wheel] @@ -198,23 +198,23 @@ builtins-ignorelist = ["format"] [tool.ruff.lint.pep8-naming] extend-ignore-names = [ - "Series", - "DataFrame", - "_Window", - "F", + "Series", + "DataFrame", + "_Window", + "F", "_F", ] [tool.ruff.lint.per-file-ignores] -"narwhals/expr_dt.py" = ["RUF002"] +"narwhals/expr_dt.py" = ["RUF002"] "narwhals/typing.py" = [ "PYI042", # snake-case-type-alias (catches `_1DArray`) -] +] "narwhals/_*/utils.py" = [ "PLR0911", # too-many-return-statements ] -"tests/*" = [ - "S101", +"narwhals-testing/narwhals_testing/tests/*" = [ + "S101", "C901", # complex-structure "PLR0912", # too-many-branches "PLR0916", # too-many-boolean-expressions @@ -250,7 +250,7 @@ skip-magic-trailing-comma = true [tool.pytest.ini_options] norecursedirs = ['*.egg', '.*', '_darcs', 'build', 'CVS', 'dist', 'node_modules', 'venv', '{arch}', 'narwhals/_*'] -testpaths = ["tests"] +testpaths = ["narwhals-testing/narwhals_testing/tests"] filterwarnings = [ "error", 'ignore:.*defaulting to pandas implementation:Warning:modin', @@ -312,7 +312,7 @@ omit = [ 'narwhals/_spark_like/typing.py', # We run Ibis in a separate CI job to the coverage one, to avoid their tight dependency pins. 'narwhals/_ibis/*', - "tests/ibis_test.py", + "narwhals-testing/narwhals_testing/tests/ibis_test.py", # Remove after finishing eager sub-protocols 'narwhals/_compliant/namespace.py', ] @@ -335,7 +335,7 @@ exclude_also = [ ] [tool.mypy] -files = ["narwhals", "tests", "test-plugin"] +files = ["narwhals", "narwhals-testing/narwhals_testing/tests", "test-plugin"] pretty = true strict = true @@ -381,9 +381,12 @@ reportMissingModuleSource = "none" reportPrivateImportUsage = "none" reportUnusedExpression = "none" # handled by (https://docs.astral.sh/ruff/rules/unused-variable/) typeCheckingMode = "basic" -include = ["narwhals", "tests", "test-plugin"] +include = ["narwhals", "narwhals-testing/narwhals_testing/tests", "test-plugin"] ignore = [ "../.venv/", "../../../**/Lib", # stdlib "../../../**/typeshed*" # typeshed-fallback ] + +[tool.uv.sources] +narwhals-testing = { path = "narwhals-testing/", editable = true }