Issue 19711: add test for changed portions after reloading a namespace package (original) (raw)

Created on 2013-11-22 16:47 by brett.cannon, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue19711-test-case.diff eric.snow,2014-03-29 02:36 review
issue19711-test_namespace_pkgs.diff eric.snow,2014-03-29 21:06 Test case making use of test_namespace_pkgs instead of rolling own dynamic generation. review
Messages (10)
msg203805 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-11-22 16:47
http://bugs.python.org/msg202660
msg215079 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2014-03-28 21:55
A related addition (Lib/test/test_importlib/test_api.py - test_reload_namespace_changed): changeset: 86819:88c3a1a3c2ff3c3ab3f2bd77f0d5d5e5c1b37afa parent: 86816:13a05ed33cf7 user: Eric Snow <ericsnowcurrently@gmail.com> date: Thu Oct 31 22:22:15 2013 -0600 summary: Issue #19413: Restore pre-3.3 reload() semantics of re-finding modules.
msg215108 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2014-03-29 02:36
Here's a patch that adds the test. However, the test is failing and my gut's telling me it's a legitimate failure. I'll verify as soon as I have a chance and open a new issue if it is legit (i.e. a regression in 3.4, albeit an unlikely corner case). Thanks for suggesting the test, Nick!
msg215142 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2014-03-29 20:34
Well, the same patch (modulo adjusting to apply cleanly) fails in exactly the same way in 3.3. So either the test isn't right or namespace packages have never supported reload in this way. I'll keep investigating.
msg215144 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2014-03-29 21:06
Regarding this issue, keep in mind that namespace packages have a dynamic __path__ which already updates (effectively) when new portions are added to sys.path. So we just need to make sure that reloading does not break that. To that end, here's a much simpler patch (with passing tests) that verifies that PEP 451 did not break anything here.
msg222286 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-07-04 14:34
Latest patch LGTM. Can we have a patch review please as #18864 is dependent on this.
msg232568 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-12-12 17:37
Do we still need this patch, Eric?
msg236535 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2015-02-24 19:47
To echo Brett's question, do we still need this patch, Eric?
msg265279 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-05-10 21:33
New changeset c22ec7a45114 by Eric Snow in branch 'default': Fixes #19711: Add tests for reloading namespace packages. https://hg.python.org/cpython/rev/c22ec7a45114
msg265280 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2016-05-10 21:34
I've gone ahead and pushed the patch.
History
Date User Action Args
2022-04-11 14:57:54 admin set github: 63910
2016-05-12 16:37:08 BreamoreBoy set nosy: - BreamoreBoy
2016-05-12 14:36:21 eric.snow set versions: + Python 3.6, - Python 3.5
2016-05-10 21:34:09 eric.snow set status: open -> closedresolution: fixedmessages: + stage: test needed -> resolved
2016-05-10 21:33:24 python-dev set nosy: + python-devmessages: +
2015-02-24 19:47:11 BreamoreBoy set status: pending -> openmessages: +
2014-12-12 17:37:42 brett.cannon set status: open -> pendingmessages: + versions: + Python 3.5, - Python 3.4
2014-07-04 14:34:50 BreamoreBoy set nosy: + BreamoreBoymessages: +
2014-03-29 21:36:53 eric.snow set assignee: eric.snow
2014-03-29 21:06:37 eric.snow set files: + issue19711-test_namespace_pkgs.diffmessages: +
2014-03-29 20:34:15 eric.snow set messages: +
2014-03-29 02:36:58 eric.snow set files: + issue19711-test-case.diffkeywords: + patchmessages: +
2014-03-28 21:55:27 eric.snow set messages: +
2013-11-23 19:53:41 Arfrever set nosy: + Arfrever
2013-11-22 16:47:16 brett.cannon link issue18864 dependencies
2013-11-22 16:47:07 brett.cannon create