From 554482320a2f236ec8ba611fdc71f526a844b574 Mon Sep 17 00:00:00 2001 From: MomIsBestFriend <> Date: Tue, 3 Dec 2019 20:29:04 +0200 Subject: [PATCH] Merge remote-tracking branch 'upstream/master' into STY-repr-batch-5 --- ci/deps/azure-windows-36.yaml | 1 + pandas/tests/groupby/test_whitelist.py | 4 ++-- pandas/tests/indexes/datetimes/test_datetime.py | 2 +- pandas/tests/indexes/multi/test_integrity.py | 4 +--- pandas/tests/indexes/test_common.py | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ci/deps/azure-windows-36.yaml b/ci/deps/azure-windows-36.yaml index 903a4b4a222f1..2bd11c9030325 100644 --- a/ci/deps/azure-windows-36.yaml +++ b/ci/deps/azure-windows-36.yaml @@ -20,6 +20,7 @@ dependencies: - numexpr - numpy=1.15.* - openpyxl + - jinja2 - pyarrow>=0.12.0 - pytables - python-dateutil diff --git a/pandas/tests/groupby/test_whitelist.py b/pandas/tests/groupby/test_whitelist.py index 5681a4517dc03..48ea2646c52fc 100644 --- a/pandas/tests/groupby/test_whitelist.py +++ b/pandas/tests/groupby/test_whitelist.py @@ -242,13 +242,13 @@ def test_groupby_blacklist(df_letters): # e.g., to_csv defined_but_not_allowed = ( - f"(?:^Cannot.+{repr(bl)}.+{repr(type(gb).__name__)}.+try " + f"(?:^Cannot.+{repr(bl)}.+'{type(gb).__name__}'.+try " f"using the 'apply' method$)" ) # e.g., query, eval not_defined = ( - f"(?:^{repr(type(gb).__name__)} object has no attribute {repr(bl)}$)" + f"(?:^'{type(gb).__name__}' object has no attribute {repr(bl)}$)" ) msg = f"{defined_but_not_allowed}|{not_defined}" diff --git a/pandas/tests/indexes/datetimes/test_datetime.py b/pandas/tests/indexes/datetimes/test_datetime.py index 97855f0abf479..08def73bb92cd 100644 --- a/pandas/tests/indexes/datetimes/test_datetime.py +++ b/pandas/tests/indexes/datetimes/test_datetime.py @@ -89,7 +89,7 @@ def test_week_of_month_frequency(self): def test_hash_error(self): index = date_range("20010101", periods=10) with pytest.raises( - TypeError, match=(f"unhashable type: {repr(type(index).__name__)}") + TypeError, match=f"unhashable type: '{type(index).__name__}'" ): hash(index) diff --git a/pandas/tests/indexes/multi/test_integrity.py b/pandas/tests/indexes/multi/test_integrity.py index 73f53a9660a01..973ed641b2cb0 100644 --- a/pandas/tests/indexes/multi/test_integrity.py +++ b/pandas/tests/indexes/multi/test_integrity.py @@ -253,9 +253,7 @@ def test_rangeindex_fallback_coercion_bug(): def test_hash_error(indices): index = indices - with pytest.raises( - TypeError, match=(f"unhashable type: {repr(type(index).__name__)}") - ): + with pytest.raises(TypeError, match=f"unhashable type: '{type(index).__name__}'"): hash(indices) diff --git a/pandas/tests/indexes/test_common.py b/pandas/tests/indexes/test_common.py index a18395c70eda2..82ef71efa70d0 100644 --- a/pandas/tests/indexes/test_common.py +++ b/pandas/tests/indexes/test_common.py @@ -161,7 +161,7 @@ def test_set_name_methods(self, indices): def test_hash_error(self, indices): index = indices with pytest.raises( - TypeError, match=(f"unhashable type: {repr(type(index).__name__)}") + TypeError, match=f"unhashable type: '{type(index).__name__}'" ): hash(indices)