Skip to content

Instantly share code, notes, and snippets.

@WillianFuks
Created October 31, 2017 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillianFuks/6d7a76c84da343db9ea6c504acb377f7 to your computer and use it in GitHub Desktop.
Save WillianFuks/6d7a76c84da343db9ea6c504acb377f7 to your computer and use it in GitHub Desktop.
Example Nox file for system testing
import os
def session_system_gae(session):
"""Runs integration tests. As this runs a real query against BigQuery,
the environemnt must have ``GOOGLE_APPLICATION_CREDENTIALS`` set pointing
to ``/key.json`` where the secrets service json must be located.
"""
session.interpreter = 'python2.7'
session.virtualenv_dirname = 'system-gae'
session.install('-r', 'gae/exporter/requirements.txt')
session.install('--upgrade', 'google-cloud-bigquery')
session.install('pytest', 'pytest-cov', 'mock')
if not os.path.isfile:
raise RuntimeError("File /key.json not found. Please make sure "
"to create this file with the service credentials "
"in order to run the integration tests")
session.env = {'PYTHONPATH': ':./',
'GOOGLE_APPLICATION_CREDENTIALS': '/key.json'}
session.run(
'py.test',
'tests/system/gae/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment