BackendTest
self, *, data_dir, tmpdir, worker_id, **kw) BackendTest(
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_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_tpcds | Child class defines a load_tpcds method that loads the required TPC-DS tables into a connection. |
supports_tpch | Child class defines a load_tpch method that loads the required TPC-H tables into a connection. |
tpc_absolute_tolerance | Absolute tolerance for floating point comparisons with pytest.approx in TPC correctness tests. |
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 . |
load_tpcds | Load TPC-DS data. |
load_tpch | Load TPC-H data. |
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
*args, **kwargs) assert_frame_equal(left, right,
Compare two Pandas DataFrames optionally ignoring order, and dtype.
force_sort
, and check_dtype
are set as class-level variables.
assert_series_equal
*args, **kwargs) assert_series_equal(left, right,
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
**kw) load_data(data_dir, tmpdir, worker_id,
Load testdata from data_dir
.
load_tpcds
load_tpcds()
Load TPC-DS data.
load_tpch
load_tpch()
Load TPC-H data.
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.