]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-138621: Increase test coverage for csv.DictReader and csv.Sniffer (GH-13862...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 12 Nov 2025 00:58:15 +0000 (01:58 +0100)
committerGitHub <noreply@github.com>
Wed, 12 Nov 2025 00:58:15 +0000 (00:58 +0000)
commit947354e338428d0ec64390c258e1f74a8d3cc603
tree7847a9f705425b835278e5e05bf3538f4f83a378
parent21c9c919aa7f217d5e7ad1d1549a556392af2143
[3.14] gh-138621: Increase test coverage for csv.DictReader and csv.Sniffer (GH-138622) (#141436)

gh-138621: Increase test coverage for csv.DictReader and csv.Sniffer (GH-138622)

* Increase test coverage for csv.DictReader and csv.Sniffer

Previously there were no tests for the DictReader fieldnames
setter, the case where a StopIteration was encountered when trying
to determine the fieldnames from the content or the case where
Sniffer could not find a delimiter.

* Revert whitespace change to comment

* Add a test that csv.Sniffer.has_header checks up to 20 rows

* Replace name and age with letter and offset

* Address review comment

---------
(cherry picked from commit 0e88be6f55f35ab045e57f9f869b893c15dcc099)

Co-authored-by: Jan-Eric Nitschke <47750513+JanEricNitschke@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Lib/test/test_csv.py