prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Error reporting system tests needed
  Follow up to #3263.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `error_reporting/nox.py`
  Content:
  ```
  1 # Copyright 2016 Google Inc.
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #     http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 
  15 from __future__ import absolute_import
  16 
  17 import os
  18 
  19 import nox
  20 
  21 
  22 LOCAL_DEPS = ('../core/', '../logging/')
  23 
  24 
  25 @nox.session
  26 @nox.parametrize('python_version', ['2.7', '3.4', '3.5', '3.6'])
  27 def unit_tests(session, python_version):
  28     """Run the unit test suite."""
  29 
  30     # Run unit tests against all supported versions of Python.
  31     session.interpreter = 'python{}'.format(python_version)
  32 
  33     # Install all test dependencies, then install this package in-place.
  34     session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
  35     session.install('-e', '.')
  36 
  37     # Run py.test against the unit tests.
  38     session.run(
  39         'py.test', '--quiet', '--cov=google.cloud.error_reporting',
  40         '--cov=tests.unit', '--cov-append', '--cov-config=.coveragerc',
  41         '--cov-report=', '--cov-fail-under=97', 'tests/unit',
  42     )
  43 
  44 
  45 @nox.session
  46 def lint(session):
  47     """Run flake8.
  48 
  49     Returns a failure if flake8 finds linting errors or sufficiently
  50     serious code quality issues.
  51     """
  52     session.interpreter = 'python3.6'
  53     session.install('flake8', *LOCAL_DEPS)
  54     session.install('.')
  55     session.run('flake8', 'google/cloud/error_reporting')
  56 
  57 
  58 @nox.session
  59 def lint_setup_py(session):
  60     """Verify that setup.py is valid (including RST check)."""
  61     session.interpreter = 'python3.6'
  62     session.install('docutils', 'Pygments')
  63     session.run(
  64         'python', 'setup.py', 'check', '--restructuredtext', '--strict')
  65 
  66 
  67 @nox.session
  68 def cover(session):
  69     """Run the final coverage report.
  70 
  71     This outputs the coverage report aggregating coverage from the unit
  72     test runs (not system test runs), and then erases coverage data.
  73     """
  74     session.interpreter = 'python3.6'
  75     session.install('coverage', 'pytest-cov')
  76     session.run('coverage', 'report', '--show-missing', '--fail-under=100')
  77     session.run('coverage', 'erase')
  78
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/error_reporting/nox.py b/error_reporting/nox.py
  --- a/error_reporting/nox.py
  +++ b/error_reporting/nox.py
  @@ -64,6 +64,28 @@
           '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('mock', 'pytest', *LOCAL_DEPS)
  +    session.install('../test_utils/')
  +    session.install('.')
  +
  +    # Run py.test against the system tests.
  +    session.run('py.test', '-vvv', 'tests/system.py')
  +
  +
   @nox.session
   def cover(session):
       """Run the final coverage report.
  
verification_info: {"golden_diff": "diff --git a/error_reporting/nox.py b/error_reporting/nox.py\n--- a/error_reporting/nox.py\n+++ b/error_reporting/nox.py\n@@ -64,6 +64,28 @@\n         'python', 'setup.py', 'check', '--restructuredtext', '--strict')\n \n \n+@nox.session\n+@nox.parametrize('python_version', ['2.7', '3.6'])\n+def system_tests(session, python_version):\n+    \"\"\"Run the system test suite.\"\"\"\n+\n+    # Sanity check: Only run system tests if the environment variable is set.\n+    if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''):\n+        return\n+\n+    # Run the system tests against latest Python 2 and Python 3 only.\n+    session.interpreter = 'python{}'.format(python_version)\n+\n+    # Install all test dependencies, then install this package into the\n+    # virtualenv's dist-packages.\n+    session.install('mock', 'pytest', *LOCAL_DEPS)\n+    session.install('../test_utils/')\n+    session.install('.')\n+\n+    # Run py.test against the system tests.\n+    session.run('py.test', '-vvv', 'tests/system.py')\n+\n+\n @nox.session\n def cover(session):\n     \"\"\"Run the final coverage report.\n", "issue": "Error reporting system tests needed\nFollow up to #3263.\n", "before_files": [{"content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom __future__ import absolute_import\n\nimport os\n\nimport nox\n\n\nLOCAL_DEPS = ('../core/', '../logging/')\n\n\n@nox.session\n@nox.parametrize('python_version', ['2.7', '3.4', '3.5', '3.6'])\ndef unit_tests(session, python_version):\n    \"\"\"Run the unit test suite.\"\"\"\n\n    # Run unit tests against all supported versions of Python.\n    session.interpreter = 'python{}'.format(python_version)\n\n    # Install all test dependencies, then install this package in-place.\n    session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)\n    session.install('-e', '.')\n\n    # Run py.test against the unit tests.\n    session.run(\n        'py.test', '--quiet', '--cov=google.cloud.error_reporting',\n        '--cov=tests.unit', '--cov-append', '--cov-config=.coveragerc',\n        '--cov-report=', '--cov-fail-under=97', 'tests/unit',\n    )\n\n\n@nox.session\ndef lint(session):\n    \"\"\"Run flake8.\n\n    Returns a failure if flake8 finds linting errors or sufficiently\n    serious code quality issues.\n    \"\"\"\n    session.interpreter = 'python3.6'\n    session.install('flake8', *LOCAL_DEPS)\n    session.install('.')\n    session.run('flake8', 'google/cloud/error_reporting')\n\n\n@nox.session\ndef lint_setup_py(session):\n    \"\"\"Verify that setup.py is valid (including RST check).\"\"\"\n    session.interpreter = 'python3.6'\n    session.install('docutils', 'Pygments')\n    session.run(\n        'python', 'setup.py', 'check', '--restructuredtext', '--strict')\n\n\n@nox.session\ndef cover(session):\n    \"\"\"Run the final coverage report.\n\n    This outputs the coverage report aggregating coverage from the unit\n    test runs (not system test runs), and then erases coverage data.\n    \"\"\"\n    session.interpreter = 'python3.6'\n    session.install('coverage', 'pytest-cov')\n    session.run('coverage', 'report', '--show-missing', '--fail-under=100')\n    session.run('coverage', 'erase')\n", "path": "error_reporting/nox.py"}], "after_files": [{"content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom __future__ import absolute_import\n\nimport os\n\nimport nox\n\n\nLOCAL_DEPS = ('../core/', '../logging/')\n\n\n@nox.session\n@nox.parametrize('python_version', ['2.7', '3.4', '3.5', '3.6'])\ndef unit_tests(session, python_version):\n    \"\"\"Run the unit test suite.\"\"\"\n\n    # Run unit tests against all supported versions of Python.\n    session.interpreter = 'python{}'.format(python_version)\n\n    # Install all test dependencies, then install this package in-place.\n    session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)\n    session.install('-e', '.')\n\n    # Run py.test against the unit tests.\n    session.run(\n        'py.test', '--quiet', '--cov=google.cloud.error_reporting',\n        '--cov=tests.unit', '--cov-append', '--cov-config=.coveragerc',\n        '--cov-report=', '--cov-fail-under=97', 'tests/unit',\n    )\n\n\n@nox.session\ndef lint(session):\n    \"\"\"Run flake8.\n\n    Returns a failure if flake8 finds linting errors or sufficiently\n    serious code quality issues.\n    \"\"\"\n    session.interpreter = 'python3.6'\n    session.install('flake8', *LOCAL_DEPS)\n    session.install('.')\n    session.run('flake8', 'google/cloud/error_reporting')\n\n\n@nox.session\ndef lint_setup_py(session):\n    \"\"\"Verify that setup.py is valid (including RST check).\"\"\"\n    session.interpreter = 'python3.6'\n    session.install('docutils', 'Pygments')\n    session.run(\n        'python', 'setup.py', 'check', '--restructuredtext', '--strict')\n\n\n@nox.session\n@nox.parametrize('python_version', ['2.7', '3.6'])\ndef system_tests(session, python_version):\n    \"\"\"Run the system test suite.\"\"\"\n\n    # Sanity check: Only run system tests if the environment variable is set.\n    if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''):\n        return\n\n    # Run the system tests against latest Python 2 and Python 3 only.\n    session.interpreter = 'python{}'.format(python_version)\n\n    # Install all test dependencies, then install this package into the\n    # virtualenv's dist-packages.\n    session.install('mock', 'pytest', *LOCAL_DEPS)\n    session.install('../test_utils/')\n    session.install('.')\n\n    # Run py.test against the system tests.\n    session.run('py.test', '-vvv', 'tests/system.py')\n\n\n@nox.session\ndef cover(session):\n    \"\"\"Run the final coverage report.\n\n    This outputs the coverage report aggregating coverage from the unit\n    test runs (not system test runs), and then erases coverage data.\n    \"\"\"\n    session.interpreter = 'python3.6'\n    session.install('coverage', 'pytest-cov')\n    session.run('coverage', 'report', '--show-missing', '--fail-under=100')\n    session.run('coverage', 'erase')\n", "path": "error_reporting/nox.py"}]}