BackendTest

BackendTest(self, *, data_dir, tmpdir, worker_id, **kw)

The base class for managing configuration and data loading for a backend that does not require Docker for testing (this includes both in-process backends and cloud backends like Snowflake and BigQuery).

Attributes

Name Description
check_dtype Check that dtypes match when comparing Pandas Series
check_names Check that column name matches when comparing Pandas Series
deps A list of dependencies that must be present to run tests.
driver_supports_multiple_statements Whether the driver supports executing multiple statements in a single call.
force_sort Sort results before comparing against reference computation.
native_bool Whether backend has native boolean types
reduction_tolerance Used for a single test in test_aggregation.py. You should not need to touch this.
rounding_method Name of round method to use for rounding test comparisons.
stateful Whether special handling is needed for running a multi-process pytest run.
supports_arrays Whether backend supports Arrays / Lists
supports_arrays_outside_of_select Whether backend supports Arrays / Lists outside of Select Statements
supports_divide_by_zero Whether backend supports division by zero
supports_floating_modulus Whether backend supports floating point in modulus operations
supports_json Whether backend supports operating on JSON
supports_map Whether backend supports mappings (currently DuckDB, Snowflake, and Trino)
supports_structs Whether backend supports Structs
supports_tpch Child class defines a load_tpch method that loads the required TPC-H tables into a connection.
supports_window_operations Whether backend supports Window Operations

Methods

Name Description
assert_frame_equal Compare two Pandas DataFrames optionally ignoring order, and dtype.
assert_series_equal Compare two Pandas Series, optionally ignoring order, dtype, and column name.
connect Return a connection with data loaded from data_dir.
load_data Load testdata from data_dir.
postload Code to execute after loading data.
preload Code to execute before loading data.
skip_if_missing_deps Add an importorskip for any missing dependencies.

assert_frame_equal

assert_frame_equal(left, right, *args, **kwargs)

Compare two Pandas DataFrames optionally ignoring order, and dtype.

force_sort, and check_dtype are set as class-level variables.

assert_series_equal

assert_series_equal(left, right, *args, **kwargs)

Compare two Pandas Series, optionally ignoring order, dtype, and column name.

force_sort, check_dtype, and check_names are set as class-level variables.

connect

connect(tmpdir, worker_id, **kw)

Return a connection with data loaded from data_dir.

load_data

load_data(data_dir, tmpdir, worker_id, **kw)

Load testdata from data_dir.

postload

postload(**_)

Code to execute after loading data.

preload

preload()

Code to execute before loading data.

skip_if_missing_deps

skip_if_missing_deps()

Add an importorskip for any missing dependencies.

Back to top