diff --git a/pandas/tests/io/conftest.py b/pandas/tests/io/conftest.py
index 828d5d0cc..57e72da2f 100644
--- a/pandas/tests/io/conftest.py
+++ b/pandas/tests/io/conftest.py
@@ -1,6 +1,5 @@
 import os
 
-import moto
 import pytest
 from pandas.io.parsers import read_table
 
@@ -42,6 +41,7 @@ def s3_resource(tips_file, jsonl_file):
     is yielded by the fixture.
     """
     pytest.importorskip('s3fs')
+    moto = pytest.importorskip('moto')
     moto.mock_s3().start()
 
     test_s3_files = [
diff --git a/pandas/tests/io/json/test_compression.py b/pandas/tests/io/json/test_compression.py
index e9976da6f..077752039 100644
--- a/pandas/tests/io/json/test_compression.py
+++ b/pandas/tests/io/json/test_compression.py
@@ -1,5 +1,4 @@
 import pytest
-import moto
 
 import pandas as pd
 from pandas import compat
@@ -73,6 +72,8 @@ def test_read_zipped_json():
 def test_with_s3_url(compression):
     boto3 = pytest.importorskip('boto3')
     pytest.importorskip('s3fs')
+    moto = pytest.importorskip('moto')
+
     if compression == 'xz':
         tm._skip_if_no_lzma()
 
diff --git a/pandas/tests/io/test_excel.py b/pandas/tests/io/test_excel.py
index 7af8bd12c..28dd49e76 100644
--- a/pandas/tests/io/test_excel.py
+++ b/pandas/tests/io/test_excel.py
@@ -12,7 +12,6 @@ from warnings import catch_warnings
 import numpy as np
 import pytest
 from numpy import nan
-import moto
 
 import pandas as pd
 import pandas.util.testing as tm
@@ -618,6 +617,7 @@ class XlrdTests(ReadingTestsBase):
     def test_read_from_s3_url(self):
         boto3 = pytest.importorskip('boto3')
         pytest.importorskip('s3fs')
+        moto = pytest.importorskip('moto')
 
         with moto.mock_s3():
             conn = boto3.resource("s3", region_name="us-east-1")
