diff options
Diffstat (limited to 'Lib/test/test_csv.py')
-rw-r--r-- | Lib/test/test_csv.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py index 196d18c..7eef4c0 100644 --- a/Lib/test/test_csv.py +++ b/Lib/test/test_csv.py @@ -598,8 +598,12 @@ class TestDictFields(unittest.TestCase): fileobj = os.fdopen(fd, "w+b") try: writer = csv.DictWriter(fileobj, fieldnames = ["f1", "f2", "f3"]) + writer.writeheader() + fileobj.seek(0) + self.assertEqual(fileobj.readline(), "f1,f2,f3\r\n") writer.writerow({"f1": 10, "f3": "abc"}) fileobj.seek(0) + fileobj.readline() # header self.assertEqual(fileobj.read(), "10,,abc\r\n") finally: fileobj.close() |