Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A google bigquery client library mocker

Project description

pipeline status coverage report

MockQuerPy

This project implements a mocking library for quick and easy testing of google bigquery based python projects

bigquery

Getting started

Instructions on getting a local developement copy on your machine

Using the Lib in your project

Basic use:

  1. $ pip install mockquerpy
  2. Use either the context manager or decorator in your tests:
from mockquerpy import MockQuerPy, mockquerpy_wrap

with MockQuerPy(TEST_DATA) as bigquery:
    print('bigquery inside here is a mockobject')

@mockquerpy_wrap
def test_my_bq_implementation(bigquery):
    print('bigquery inside here is a mockobject')
    MockQuerPy.set_test_data(MY_TEST_DATA)

See the project documentation for more // TODO

Developing the library

Prereq
  • Python 3.7 or higher
Instructions

Developing the library:

  1. Set up a python virtualenv $ virtualenv venv && source venv/bin/activate
  2. Install the dependencies $ pip install -r requirements.txt

Testing

Project is being tested using the pytest framework. This is also added to the CI pipeline.

$ pytest .

Deploying

Deployment is and should be handled by the CD pipeline to the project, but can be done manually:

Project details


Download files

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

Files for mockquerpy, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size mockquerpy-0.1.0-py3-none-any.whl (7.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size mockquerpy-0.1.0.tar.gz (4.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page