msg160751 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2012-05-15 19:19 |
Subject says it all. There are also no tests of .pkg files. |
|
|
msg160784 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2012-05-16 00:46 |
New changeset 48cb6b67d306 by Eric V. Smith in branch '3.2': Issue #14817: Add rudimentary tests for pkgutil.extend_path. http://hg.python.org/cpython/rev/48cb6b67d306 |
|
|
msg160785 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2012-05-16 00:48 |
I'm going to leave this open until better tests are added. The one I did add it very simple, but it's good enough for the changes I'm about to make. |
|
|
msg160792 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2012-05-16 01:43 |
This code does not clean up correctly. It needs to remove the added modules in sys.modules. I'll eventually clean it up, once issue 14715 is addressed. |
|
|
msg160809 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2012-05-16 07:54 |
This has broken all 3.x buildbots. |
|
|
msg221843 - (view) |
Author: Mark Lawrence (BreamoreBoy) * |
Date: 2014-06-29 13:34 |
@Eric will you pick this up again? |
|
|
msg338577 - (view) |
Author: Windson Yang (Windson Yang) * |
Date: 2019-03-22 02:00 |
I would like to work on this and make a PR. |
|
|
msg338934 - (view) |
Author: Windson Yang (Windson Yang) * |
Date: 2019-03-27 01:55 |
My base idea would be some unittests for the function like: class ExtendPathBaseTests(unittest.TestCase): def test_input_string(self): path = 'path' name = 'foo' self.assertEqual('path', pkgutil.extend_path(path, name)) def test_parent_package_raise_key_error(self): path = ['path'] # sys.modules['foo'] raise KeyError name = 'foo.bar' self.assertEqual(['path'], pkgutil.extend_path(path, name)) def test_parent_package_raise_attr_error(self): path = ['path'] # datetime module don't have __path__ attr name = 'datetime.date' self.assertEqual(['path'], pkgutil.extend_path(path, name)) I would move forward if we agreed. |
|
|
msg339764 - (view) |
Author: Joannah Nanjekye (nanjekyejoannah) *  |
Date: 2019-04-09 15:26 |
@Windson please open a PR for review with your code. |
|
|
msg340465 - (view) |
Author: Windson Yang (Windson Yang) * |
Date: 2019-04-18 03:16 |
I added some tests in the PR. Actually, there are some tests for extend_path already (see https://github.com/python/cpython/blob/master/Lib/test/test_pkgutil.py#L235). However, I didn't test every line of the code in the extend_path function. |
|
|