{"id":15060765,"url":"https://github.com/poogles/pytest-bq","last_synced_at":"2026-02-11T07:02:24.845Z","repository":{"id":238856536,"uuid":"797813940","full_name":"Poogles/pytest-bq","owner":"Poogles","description":"pytest fixtures for a local bigquery suitable for local development.","archived":false,"fork":false,"pushed_at":"2024-05-08T18:36:40.000Z","size":39,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-24T21:40:25.922Z","etag":null,"topics":["bigquery","bigquery-emulator","pytest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Poogles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-08T15:10:02.000Z","updated_at":"2025-09-02T22:33:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"59f73491-0bf8-412a-9f87-c5f355aa5b4f","html_url":"https://github.com/Poogles/pytest-bq","commit_stats":null,"previous_names":["poogles/pytest-bq"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Poogles/pytest-bq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpytest-bq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpytest-bq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpytest-bq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpytest-bq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Poogles","download_url":"https://codeload.github.com/Poogles/pytest-bq/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpytest-bq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29329492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bigquery","bigquery-emulator","pytest"],"created_at":"2024-09-24T23:04:17.985Z","updated_at":"2026-02-11T07:02:24.801Z","avatar_url":"https://github.com/Poogles.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Pytest BQ\n\nThis is a pytest plugin in similar vein to [pytest-postgres](https://github.com/ClearcodeHQ/pytest-postgresql) and [pytest-kafka](https://pypi.org/project/pytest-kafka/). It runs a local version of bigquery that you can use throughout your test suite. \n\nThis would have been much more painful without [Mirakuru](https://github.com/ClearcodeHQ/mirakuru)\nand [bigquery-emulator](https://github.com/goccy/bigquery-emulator); this is a simple wrapper around\nthose tools.\n\n\n### Installation\n\nThis tool requires you to have a copy of the `bigquery-emulator` binary somewhere on your path.\nDepending upon your architecture you'll need a different version of the tool.\n\n```sh\nwget https://github.com/goccy/bigquery-emulator/releases/download/v0.6.1/bigquery-emulator-linux-amd64\nmv bigquery-emulator-linux-amd64 /usr/local/bin/bigquery-emulator\n```\n\nTo install this library:\n\n```sh\npip install pytest-bq\n```\n\n\n### Demo\n\n```python\n# conftest.py\nfrom pytest_bq.factories import client as bq_client\nfrom pytest_bq.factories import proc as bq_process\n\n# Create a process and a local client that targets that process.\nbq_proc = bq_process.bq_proc(executable='/usr/local/bin/bigquery-emulator', project_id='test')\nbqlocal = bq_client.bqlocal(\"bq_proc\")\n\n# tests/test_bq.py\nfrom google.cloud import bigquery\nfrom pytest_bq.executor.process import BQExecutor\n\n\ndef test_can_list_datasets(bq_proc: BQExecutor, bqlocal: bigquery.Client) -\u003e None:\n    \"\"\"MVP to ensure everything works.\"\"\"\n    test_dataset = \"test_base\"\n    bqlocal.create_dataset(test_dataset)\n    datasets = [x.full_dataset_id for x in bqlocal.list_datasets()]\n\n    assert test_dataset in datasets\n```\n\n\n### Contributing\n\nPRs are accepted.\n\n```sh\n# Install the dependencies with:\npip install .[test]\n# Install pre-commit hooks.\npre-commit install\n# Validate everything passes.\npre-commit run --all\n# Run the tests.\npytest tests/\n```\n\n\n### TODOs\n\n* Validate `data_from_yaml` files.\n* Tools for dummy data generation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoogles%2Fpytest-bq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoogles%2Fpytest-bq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoogles%2Fpytest-bq/lists"}