diff options
author | Brett Cannon <brett@python.org> | 2016-09-08 01:39:18 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2016-09-08 01:39:18 (GMT) |
commit | 035a1003820c0148b9a12f3034829fcc655a92bb (patch) | |
tree | 70e69c549aee6c15150b402951999419135984cb /Lib/test/test_importlib/test_spec.py | |
parent | d5f92239818eef182fadc7c6f81f70912090573d (diff) | |
download | cpython-035a1003820c0148b9a12f3034829fcc655a92bb.zip cpython-035a1003820c0148b9a12f3034829fcc655a92bb.tar.gz cpython-035a1003820c0148b9a12f3034829fcc655a92bb.tar.bz2 |
Issue #26667: Add path-like object support to importlib.util.
Diffstat (limited to 'Lib/test/test_importlib/test_spec.py')
-rw-r--r-- | Lib/test/test_importlib/test_spec.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_spec.py b/Lib/test/test_importlib/test_spec.py index 8b333e8..5a16a03 100644 --- a/Lib/test/test_importlib/test_spec.py +++ b/Lib/test/test_importlib/test_spec.py @@ -5,6 +5,7 @@ machinery = test_util.import_importlib('importlib.machinery') util = test_util.import_importlib('importlib.util') import os.path +import pathlib from test.support import CleanImport import unittest import sys @@ -659,6 +660,11 @@ class FactoryTests: self.assertEqual(spec.cached, self.cached) self.assertTrue(spec.has_location) + def test_spec_from_file_location_path_like_arg(self): + spec = self.util.spec_from_file_location(self.name, + pathlib.PurePath(self.path)) + self.assertEqual(spec.origin, self.path) + def test_spec_from_file_location_default_without_location(self): spec = self.util.spec_from_file_location(self.name) |