Skip to content

Import error in trace unit tests #3743

Closed
@duggelz

Description

@duggelz

It looks like trace/ needs to be updated to match changes elsewhere. Also, trace/nox.py seems to be missing some recent changes made to the other nox.py files.

To reproduce:

$ docker run -it --entrypoint=/bin/bash gcr.io/google-appengine/python:latest
$ git clone --depth 1 https://github.com/GoogleCloudPlatform/google-cloud-python.git
$ pip install --upgrade nox-automation
$ cd /app/google-cloud-python
$ nox -f trace/nox.py -e "unit_tests(python_version='3.4')"

Output:

nox > Running session unit_tests(python_version='3.4')
nox > virtualenv /home/vmagent/app/google-cloud-python/.nox/unit_tests-python_version-3-4 -p python3.4
nox > chdir /home/vmagent/app/google-cloud-python/trace
nox > pip install --upgrade mock pytest pytest-cov ../core/
nox > pip install --upgrade -e .
nox > py.test --quiet --cov=google.cloud.trace --cov-append --cov-config=.coveragerc --cov-report= --cov-fail-under=97 tests/
Coverage.py warning: Module google.cloud.trace was never imported. (module-not-imported)



Required test coverage of 97% reached. Total coverage: 100.00%
========================================================================= ERRORS ==========================================================================
_____________________________________________________ ERROR collecting trace/tests/unit/test__gax.py ______________________________________________________
ImportError while importing test module '/home/vmagent/app/google-cloud-python/trace/tests/unit/test__gax.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/unit/test__gax.py:19: in <module>
    from google.cloud._testing import _GAXBaseAPI
E   ImportError: No module named 'google.cloud._testing'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1 error in 0.82 seconds
nox > Command py.test --quiet --cov=google.cloud.trace --cov-append --cov-config=.coveragerc --cov-report= --cov-fail-under=97 tests/ failed with exit code 2
nox > Session unit_tests(python_version='3.4') failed. :(

Metadata

Metadata

Assignees

Labels

api: cloudtraceIssues related to the Cloud Trace API.priority: p2Moderately-important priority. Fix may not be included in next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions