summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 84ef150..bf06438 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -3121,6 +3121,13 @@ class TestPEP519(unittest.TestCase):
self.assertEqual(b"path/like/object", os.fsencode(pathlike))
self.assertEqual("path/like/object", os.fsdecode(pathlike))
+ def test_fspathlike(self):
+ class PathLike(object):
+ def __fspath__(self):
+ return '#feelthegil'
+
+ self.assertEqual('#feelthegil', os.fspath(PathLike()))
+
def test_garbage_in_exception_out(self):
vapor = type('blah', (), {})
for o in int, type, os, vapor():