diff --git a/influxdb/tests/client_test.py b/influxdb/tests/client_test.py index 115fbc48..3e20598b 100644 --- a/influxdb/tests/client_test.py +++ b/influxdb/tests/client_test.py @@ -27,7 +27,10 @@ import io import gzip import json -import mock +try: + from unittest import mock +except ImportError: + import mock import requests import requests.exceptions import requests_mock diff --git a/influxdb/tests/helper_test.py b/influxdb/tests/helper_test.py index 6737f921..5756b76f 100644 --- a/influxdb/tests/helper_test.py +++ b/influxdb/tests/helper_test.py @@ -11,7 +11,10 @@ import unittest import warnings -import mock +try: + from unittest import mock +except ImportError: + import mock from influxdb import SeriesHelper, InfluxDBClient from requests.exceptions import ConnectionError diff --git a/influxdb/tests/influxdb08/client_test.py b/influxdb/tests/influxdb08/client_test.py index 39ab52d6..5c44673b 100644 --- a/influxdb/tests/influxdb08/client_test.py +++ b/influxdb/tests/influxdb08/client_test.py @@ -8,7 +8,10 @@ import random import warnings -import mock +try: + from unittest import mock +except ImportError: + import mock import requests import requests.exceptions import requests_mock diff --git a/influxdb/tests/influxdb08/helper_test.py b/influxdb/tests/influxdb08/helper_test.py index 2e305f3f..4a618ad9 100644 --- a/influxdb/tests/influxdb08/helper_test.py +++ b/influxdb/tests/influxdb08/helper_test.py @@ -4,7 +4,10 @@ import unittest import warnings -import mock +try: + from unittest import mock +except ImportError: + import mock from influxdb.influxdb08 import SeriesHelper, InfluxDBClient from requests.exceptions import ConnectionError