diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-10-01 05:02:22 +0300 |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-10-01 05:02:22 +0300 |
commit | c4bd96cce2023e21feb615e703968b25b2ae6aac (patch) | |
tree | a81e14a48fbc1d14fd4003a45443cc1f600b718e /Lib/test | |
parent | 78a111c7d86754d0658f21db49ac085c032be911 (diff) | |
parent | ef223a19f76101a914ccff8b4690d9e4717e109e (diff) | |
download | cpython-git-c4bd96cce2023e21feb615e703968b25b2ae6aac.tar.gz |
Issue #28228: Merge from 3.6
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_imghdr.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_imghdr.py b/Lib/test/test_imghdr.py index b54daf8e2c..476ba95f17 100644 --- a/Lib/test/test_imghdr.py +++ b/Lib/test/test_imghdr.py @@ -1,6 +1,7 @@ import imghdr import io import os +import pathlib import unittest import warnings from test.support import findfile, TESTFN, unlink @@ -49,6 +50,12 @@ class TestImghdr(unittest.TestCase): self.assertEqual(imghdr.what(None, data), expected) self.assertEqual(imghdr.what(None, bytearray(data)), expected) + def test_pathlike_filename(self): + for filename, expected in TEST_FILES: + with self.subTest(filename=filename): + filename = findfile(filename, subdir='imghdrdata') + self.assertEqual(imghdr.what(pathlib.Path(filename)), expected) + def test_register_test(self): def test_jumbo(h, file): if h.startswith(b'eggs'): |