From b97e4e84886eec602e687173605762976d5b0c01 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 11 Dec 2017 00:10:22 +0100 Subject: [PATCH 1/3] TST: make it possible to run tests without moto installed --- pandas/tests/io/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/conftest.py b/pandas/tests/io/conftest.py index 828d5d0ccd3c6..57e72da2fd3f4 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 = [ From 117708648c16dc760a21da90ec9e6670fde61000 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 11 Dec 2017 00:37:35 +0100 Subject: [PATCH 2/3] more motos --- pandas/tests/io/json/test_compression.py | 3 ++- pandas/tests/io/test_excel.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/tests/io/json/test_compression.py b/pandas/tests/io/json/test_compression.py index e9976da6f6774..cd889b424d13a 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.importskip('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 3fd55bcad677a..4efeeecf8ee4a 100644 --- a/pandas/tests/io/test_excel.py +++ b/pandas/tests/io/test_excel.py @@ -10,7 +10,6 @@ import numpy as np import pytest from numpy import nan -import moto import pandas as pd import pandas.util.testing as tm @@ -616,6 +615,7 @@ def test_read_from_http_url(self): 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") From cdf82ac41354dcebf29383878a8c2fc90ed4d54e Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 11 Dec 2017 09:24:02 +0100 Subject: [PATCH 3/3] typo --- pandas/tests/io/json/test_compression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/json/test_compression.py b/pandas/tests/io/json/test_compression.py index cd889b424d13a..077752039a558 100644 --- a/pandas/tests/io/json/test_compression.py +++ b/pandas/tests/io/json/test_compression.py @@ -72,7 +72,7 @@ def test_read_zipped_json(): def test_with_s3_url(compression): boto3 = pytest.importorskip('boto3') pytest.importorskip('s3fs') - moto = pytest.importskip('moto') + moto = pytest.importorskip('moto') if compression == 'xz': tm._skip_if_no_lzma()