Skip to main content

Mock SnowflakeDB locally

Project description

fakesnow ❄️

Fake Snowflake Connector for Python. Run Snowflake DB locally.

Usage

import fakesnow
import snowflake.connector

with fakesnow.patch():
    conn = snowflake.connector.connect()

    print(conn.cursor().execute("SELECT 'Hello fake world!'").fetchone())

Standard imports (eg: snowflake.connector.connect) are patched. To patch additional imports, eg:

with fakesnow.patch("mymodule.connect"):
    ...

pytest fixtures are provided for testing. Example conftest.py:

from typing import Iterator

import fakesnow.fixtures
import pytest

pytest_plugins = fakesnow.fixtures.__name__

@pytest.fixture(scope="session", autouse=True)
def setup(_fakesnow_session: None) -> Iterator[None]:
    # the standard imports are now patched
    ...
    yield

Implementation coverage

Partial support

  • date functions
  • tags
  • semi-structured data

Contributing

See CONTRIBUTING.md to get started and develop in this repo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fakesnow-0.0.0.tar.gz (20.6 kB view hashes)

Uploaded Source

Built Distribution

fakesnow-0.0.0-py3-none-any.whl (13.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page