CLN: Fix all flake8 warnings in pandas/tests
State: closed

Ouch my wrists. I will rebase and fix the post-rebase entropy tomorrow. 


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Code Style
description: Code style, linting, code_checks

Comments:
```
22:54 ~/code/pandas  (style/flake8-pandas-tests)$ git diff master --stat
 pandas/tests/frame/test_operators.py        |    2 +-
 pandas/tests/test_algos.py                  |  253 ++++----
 pandas/tests/test_base.py                   |  296 +++++----
 pandas/tests/test_categorical.py            | 2294 +++++++++++++++++++++++++++++++++++++---------------------------
 pandas/tests/test_common.py                 |  400 ++++++------
 pandas/tests/test_compat.py                 |   20 +-
 pandas/tests/test_config.py                 |   13 +-
 pandas/tests/test_dtypes.py                 |   57 +-
 pandas/tests/test_expressions.py            |  135 ++--
 pandas/tests/test_format.py                 | 1051 +++++++++++++++---------------
 pandas/tests/test_generic.py                |  685 ++++++++++---------
 pandas/tests/test_graphics.py               |  686 +++++++++++---------
 pandas/tests/test_graphics_others.py        |  182 ++++--
 pandas/tests/test_groupby.py                | 2448 ++++++++++++++++++++++++++++++++++++--------------------------------
 pandas/tests/test_index.py                  | 1427 ++++++++++++++++++++++------------------
 pandas/tests/test_indexing.py               | 4188 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------
 pandas/tests/test_internals.py              |  308 +++++----
 pandas/tests/test_lib.py                    |   29 +-
 pandas/tests/test_msgpack/test_case.py      |   64 +-
 pandas/tests/test_msgpack/test_except.py    |   19 +-
 pandas/tests/test_msgpack/test_extension.py |   42 +-
 pandas/tests/test_msgpack/test_format.py    |   96 +--
 pandas/tests/test_msgpack/test_limits.py    |   24 +-
 pandas/tests/test_msgpack/test_newspec.py   |   24 +-
 pandas/tests/test_msgpack/test_obj.py       |   29 +-
 pandas/tests/test_msgpack/test_pack.py      |   57 +-
 pandas/tests/test_msgpack/test_read_size.py |    6 +-
 pandas/tests/test_msgpack/test_seq.py       |   16 +-
 pandas/tests/test_msgpack/test_sequnpack.py |    6 +-
 pandas/tests/test_msgpack/test_subtype.py   |    7 +-
 pandas/tests/test_msgpack/test_unpack.py    |    7 +-
 pandas/tests/test_multilevel.py             |  498 +++++++-------
 pandas/tests/test_nanops.py                 |  418 +++++-------
 pandas/tests/test_panel.py                  |  780 +++++++++++-----------
 pandas/tests/test_panel4d.py                |   70 +-
 pandas/tests/test_panelnd.py                |   20 +-
 pandas/tests/test_reshape.py                |  347 ++++++----
 pandas/tests/test_rplot.py                  |   39 +-
 pandas/tests/test_series.py                 | 2066 +++++++++++++++++++++++++++++++---------------------------
 pandas/tests/test_stats.py                  |   19 +-
 pandas/tests/test_strings.py                |  497 +++++++-------
 pandas/tests/test_style.py                  |   74 ++-
 pandas/tests/test_testing.py                |  175 +++--
 pandas/tests/test_tseries.py                |  151 ++---
 pandas/tests/test_util.py                   |    6 +-
 pandas/tests/test_window.py                 | 1488 +++++++++++++++++++++++-------------------
 46 files changed, 11978 insertions(+), 9541 deletions(-)
```

I had to disable flake8 checking on a couple of modules. I left `TODO` notes about it per #12066 mainly

Rebased on master. @jreback feel free to merge if Travis is green

merged (with new `merge-pr.py` script). thanks!

looking pretty good! not much left at all

```
linting [ok_for_now] -> pandas/tests
6       E402 module level import not at top of file
1       E711 comparison to None should be 'if cond is None:'
13      W503 line break before binary operator
```

Weird, I wonder why those aren't showing up for me locally. Good progress though