]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-138621: Increase test coverage for csv.DictReader and csv.Sniffer (GH-138622)
authorJan-Eric Nitschke <47750513+JanEricNitschke@users.noreply.github.com>
Wed, 12 Nov 2025 00:32:26 +0000 (01:32 +0100)
committerGitHub <noreply@github.com>
Wed, 12 Nov 2025 00:32:26 +0000 (00:32 +0000)
commit0e88be6f55f35ab045e57f9f869b893c15dcc099
tree4fccf41dedea46e813cfb325ae4589eb189554d5
parent0d7b48a8f5de5c1c6d57e1cf7194b6fb222d92e5
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

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Address review comment

---------

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