summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dbm_ndbm.py
diff options
context:
space:
mode:
authorHenry-Joseph Audéoud <h.audeoud@gmail.com>2021-09-10 12:26:16 (GMT)
committerGitHub <noreply@github.com>2021-09-10 12:26:16 (GMT)
commit707137b8637feef37b2e06a851fdca9d1b945861 (patch)
treeeedd9bec5c0b98b244438e120ee12d8143906c19 /Lib/test/test_dbm_ndbm.py
parent62fa613f6a6e872723505ee9d56242c31a654a9d (diff)
downloadcpython-707137b8637feef37b2e06a851fdca9d1b945861.zip
cpython-707137b8637feef37b2e06a851fdca9d1b945861.tar.gz
cpython-707137b8637feef37b2e06a851fdca9d1b945861.tar.bz2
bpo-40563: Support pathlike objects on dbm/shelve (GH-21849)
Co-authored-by: Hakan Çelik <hakancelik96@outlook.com>
Diffstat (limited to 'Lib/test/test_dbm_ndbm.py')
-rw-r--r--Lib/test/test_dbm_ndbm.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_dbm_ndbm.py b/Lib/test/test_dbm_ndbm.py
index 639c833..e57d9ca 100644
--- a/Lib/test/test_dbm_ndbm.py
+++ b/Lib/test/test_dbm_ndbm.py
@@ -124,6 +124,15 @@ class DbmTestCase(unittest.TestCase):
self.assertIn(nonexisting_file, str(cm.exception))
self.assertEqual(cm.exception.filename, nonexisting_file)
+ def test_open_with_pathlib_path(self):
+ dbm.ndbm.open(os_helper.FakePath(self.filename), "c").close()
+
+ def test_open_with_bytes_path(self):
+ dbm.ndbm.open(os.fsencode(self.filename), "c").close()
+
+ def test_open_with_pathlib_bytes_path(self):
+ dbm.ndbm.open(os_helper.FakePath(os.fsencode(self.filename)), "c").close()
+
if __name__ == '__main__':
unittest.main()