MAINT: Add more pytest idiom to parser tests
State: closed

This is only a start.  To keep the diff small, we are only converting `c_parser_only`.

If this looks good, the other test classes will soon follow in subsequent PR's.

cc @jreback 

Labels:
name: Refactor
description: Internal refactoring of code
name: Testing
description: pandas testing functions or related to the test suite
name: IO CSV
description: read_csv, to_csv

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

 - There are no PEP8 issues in the file [`pandas/tests/io/parser/conftest.py`](https://github.com/gfyoung/pandas/blob/951f0f801d57bb2d9c668065602955c841348041/pandas/tests/io/parser/conftest.py) !

 - There are no PEP8 issues in the file [`pandas/tests/io/parser/test_c_parser_only.py`](https://github.com/gfyoung/pandas/blob/951f0f801d57bb2d9c668065602955c841348041/pandas/tests/io/parser/test_c_parser_only.py) !

 - There are no PEP8 issues in the file [`pandas/tests/io/parser/test_parsers.py`](https://github.com/gfyoung/pandas/blob/951f0f801d57bb2d9c668065602955c841348041/pandas/tests/io/parser/test_parsers.py) !


# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23712?src=pr&el=h1) Report
> Merging [#23712](https://codecov.io/gh/pandas-dev/pandas/pull/23712?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/69203636c2f661bbc167a5a4fc91ea7d30ff0b67?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/23712/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/23712?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #23712   +/-   ##
=======================================
  Coverage   92.24%   92.24%           
=======================================
  Files         161      161           
  Lines       51336    51336           
=======================================
  Hits        47357    47357           
  Misses       3979     3979
```

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


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23712?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/23712?src=pr&el=footer). Last update [6920363...d916288](https://codecov.io/gh/pandas-dev/pandas/pull/23712?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

how do you run all of the tests on the c parser though? don't you need to also inject the fixture into the current test_parser.py?
@jreback @jbrockmendel : Here is the plan:

* `c_parser_only.py` is now separate from `test_parsers.py`, so you can just run `pytest test_c_parser_only.py` (the fixtures get automatically injected per the newly created `conftest.py`).  The new format of those tests is 100% functional (no classes), which is more `pytest`-idiomatic.

* If this format looks good, I will convert all other files (e.g. `header.py`, `comment.py`, `mangle_dupe_cols.py` similarly in subsequent PR's (we will be in this weird intermediate state with `test_parsers.py` and `conftest.py` co-existing).

Once that is done, we no longer need `test_parsers.py`.  All tests will be nice and modular and not all clumped into one giant test class as they are currently.

Hopefully that clears things up?
@jreback : Any further thoughts on this?
lgtm @gfyoung keep em coming!