Close ZipFile in compression test
State: closed

Maybe fixes #22675 
Maybe fixed #22682

Labels:
name: Unreliable Test
description: Unit tests that occasionally fail

Comments:
Hello @TomAugspurger! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/tests/io/test_pickle.py`](https://github.com/TomAugspurger/pandas/blob/0af493f56b8b94895701a4591e1a4daf57f9553a/pandas/tests/io/test_pickle.py) !

 - There are no PEP8 issues in the file [`pandas/util/testing.py`](https://github.com/TomAugspurger/pandas/blob/0af493f56b8b94895701a4591e1a4daf57f9553a/pandas/util/testing.py) !

 - Complete extra results for this file :

> file_to_check.py:2442:-258: W605 invalid escape sequence '\('
file_to_check.py:2442:-255: W605 invalid escape sequence '\)'
---


@Zac-HD any thoughts on this hypothesis failures?

```
__________________________ test_tick_equality[Milli] ___________________________

cls = <class 'pandas.tseries.offsets.Milli'>

    @pytest.mark.parametrize('cls', tick_classes)
>   @example(n=2, m=3)
    @given(n=st.integers(-999, 999), m=st.integers(-999, 999))
    def test_tick_equality(cls, n, m):
E   hypothesis.errors.FailedHealthCheck: Data generation is extremely slow: Only produced 6 valid examples in 1.20 seconds (0 invalid ones and 0 exceeded maximum size). Try decreasing size of the data you're generating (with e.g.max_size or max_leaves parameters).
E   See https://hypothesis.readthedocs.io/en/latest/healthchecks.html for more information about this. If you want to disable just this health check, add HealthCheck.too_slow to the suppress_health_check settings for this test.
```

We've set that value in `pandas/conftest.py` https://github.com/pandas-dev/pandas/blob/c04035360a179e82fc534cb4f38979615c53191f/pandas/conftest.py#L13, is that correct?
Ah, not quite - you need to assign to `hypothesis.settings.default.suppress_health_check`.  At this point though I'd suggest

```python
hypothesis.settings.register_profile(
    "ci", 
    suppress_health_check=(hypothesis.HealthCheck.too_slow,)
) 
hypothesis.settings.load_profile("ci")
```

might be less error-prone, and easier to add to in future! 
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22679?src=pr&el=h1) Report
> Merging [#22679](https://codecov.io/gh/pandas-dev/pandas/pull/22679?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/c04035360a179e82fc534cb4f38979615c53191f?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/22679/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/22679?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #22679   +/-   ##
=======================================
  Coverage   92.17%   92.17%           
=======================================
  Files         169      169           
  Lines       50715    50715           
=======================================
  Hits        46747    46747           
  Misses       3968     3968
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.58% <ø> (ø)` | :arrow_up: |
| #single | `42.35% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22679?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/22679/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `85.96% <ø> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22679?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22679?src=pr&el=footer). Last update [c040353...57f4a5a](https://codecov.io/gh/pandas-dev/pandas/pull/22679?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@TomAugspurger - FYI HypothesisWorks/hypothesis#1572 will ensure that settings issue can't come back.
Merging this in an hour if there are no objections, as this is causing issues on master.

For now I'm ok with just skipping those tests @WillAyd, but I'm not at all against bumping our excel-related minimum versions and doing a bit of a cleanup (in a separate PR 😄).