diff options
author | Maor Kleinberger <kmaork@gmail.com> | 2020-03-08 22:43:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 20:43:17 +0000 |
commit | 0911ea5c172264eaefa3efe4a1788159c160920d (patch) | |
tree | fad7f723dadd5b83d61aef153478935690ee3c08 /Lib/test/test_runpy.py | |
parent | 4ca060d8ad7c6df1fd4df30f9a14f6aa35380c09 (diff) | |
download | cpython-git-0911ea5c172264eaefa3efe4a1788159c160920d.tar.gz |
bpo-39517: Allow runpy.run_path() to accept path-like objects (GH-18699)
Diffstat (limited to 'Lib/test/test_runpy.py')
-rw-r--r-- | Lib/test/test_runpy.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_runpy.py b/Lib/test/test_runpy.py index f003086111..84834d39b1 100644 --- a/Lib/test/test_runpy.py +++ b/Lib/test/test_runpy.py @@ -8,6 +8,7 @@ import tempfile import importlib, importlib.machinery, importlib.util import py_compile import warnings +import pathlib from test.support import ( forget, make_legacy_pyc, unload, verbose, no_tracing, create_empty_file, temp_dir) @@ -652,6 +653,14 @@ class RunPathTestCase(unittest.TestCase, CodeExecutionMixin): self._check_script(script_name, "<run_path>", script_name, script_name, expect_spec=False) + def test_basic_script_with_path_object(self): + with temp_dir() as script_dir: + mod_name = 'script' + script_name = pathlib.Path(self._make_test_script(script_dir, + mod_name)) + self._check_script(script_name, "<run_path>", script_name, + script_name, expect_spec=False) + def test_basic_script_no_suffix(self): with temp_dir() as script_dir: mod_name = 'script' |