Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions error_reporting/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,25 @@ def lint_setup_py(session):
session.run(
'python', 'setup.py', 'check', '--restructuredtext', '--strict')

@nox.session
@nox.parametrize('python_version', ['2.7', '3.6'])
def system_tests(session, python_version):
"""Run the system test suite."""

# Sanity check: Only run system tests if the environment variable is set.
if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''):
return

# Run the system tests against latest Python 2 and Python 3 only.
session.interpreter = 'python{}'.format(python_version)

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('.')

This comment was marked as spam.


# Run py.test against the system tests.
session.run('py.test', '-vvv', 'tests/system.py')

This comment was marked as spam.

This comment was marked as spam.



@nox.session
def cover(session):
Expand Down
27 changes: 27 additions & 0 deletions error_reporting/tests/system.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest

from google.cloud import error_reporting


class TestErrorReporting(unittest.TestCase):

def test_report_exception(self):
client = error_reporting.Client()
try:
raise NameError
except NameError:
client.report_exception()

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.