diff --git a/opentelemetry-api/tests/conftest.py b/opentelemetry-api/tests/conftest.py new file mode 100644 index 0000000000..8603746ab5 --- /dev/null +++ b/opentelemetry-api/tests/conftest.py @@ -0,0 +1,19 @@ +# Copyright 2019, OpenTelemetry Authors +# +# 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. + + +def pytest_sessionstart(session): + from typeguard.importhook import install_import_hook + + install_import_hook("opentelemetry") diff --git a/opentelemetry-sdk/tests/conftest.py b/opentelemetry-sdk/tests/conftest.py new file mode 100644 index 0000000000..8603746ab5 --- /dev/null +++ b/opentelemetry-sdk/tests/conftest.py @@ -0,0 +1,19 @@ +# Copyright 2019, OpenTelemetry Authors +# +# 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. + + +def pytest_sessionstart(session): + from typeguard.importhook import install_import_hook + + install_import_hook("opentelemetry") diff --git a/tox.ini b/tox.ini index 9898094ca3..ca80825f30 100644 --- a/tox.ini +++ b/tox.ini @@ -25,6 +25,7 @@ deps = ; skip 5.2.3 pytest due to bug ; https://github.com/pytest-dev/pytest/issues/6194 test: pytest!=5.2.3 + test: typeguard coverage: pytest!=5.2.3 coverage: pytest-cov mypy,mypyinstalled: mypy==0.740