duckdb / dbt-duckdb

dbt (http://getdbt.com) adapter for DuckDB (http://duckdb.org)
Apache License 2.0
852 stars 77 forks source link

fix: clear connections before tests #113

Closed AlexanderVR closed 1 year ago

AlexanderVR commented 1 year ago

There are two tests which expect no connections to be opened. This is the case when run by themselves, but running other tests in the same pytest session can affect the class-level variable DuckDBConnectionManager.CONN

Until this class-level variable can be fixed, we reset the connections before these affected tests.

@jwills would you prefer that before every test runs the connections are reset? Can instead have a pytest fixture with autouse=True if you would prefer a less ad-hoc, if more invasive, approach.