[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

Issue 19711: add test for changed portions after reloading a namespace package

The Wayback Machine - https://web.archive.org/web/20210523113613/https://bugs.python.org/issue19711

Issue19711

classification
Title: add test for changed portions after reloading a namespace package
Type: Stage: resolved
Components: Tests Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.snow Nosy List: Arfrever, brett.cannon, eric.snow, ncoghlan, python-dev
Priority: normal Keywords: patch

Created on 2013-11-22 16:47 by brett.cannon, last changed 2016-05-12 16:37 by BreamoreBoy. 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) * Date: 2013-11-22 16:47
http://bugs.python.org/msg202660
msg215079 - (view) Author: Eric Snow (eric.snow) * 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) * 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) * 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) * 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) * 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) 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) * Date: 2016-05-10 21:34
I've gone ahead and pushed the patch.
History
Date User Action Args
2016-05-12 16:37:08BreamoreBoysetnosy: - BreamoreBoy
2016-05-12 14:36:21eric.snowsetversions: + Python 3.6, - Python 3.5
2016-05-10 21:34:09eric.snowsetstatus: open -> closed
resolution: fixed
messages: + msg265280

stage: test needed -> resolved

2016-05-10 21:33:24python-devsetnosy: + python-dev
messages: + msg265279
2015-02-24 19:47:11BreamoreBoysetstatus: pending -> open

messages: + msg236535

2014-12-12 17:37:42brett.cannonsetstatus: open -> pending

messages: + msg232568
versions: + Python 3.5, - Python 3.4

2014-07-04 14:34:50BreamoreBoysetnosy: + BreamoreBoy
messages: + msg222286
2014-03-29 21:36:53eric.snowsetassignee: eric.snow
2014-03-29 21:06:37eric.snowsetfiles: + issue19711-test_namespace_pkgs.diff

messages: + msg215144

2014-03-29 20:34:15eric.snowsetmessages: + msg215142
2014-03-29 02:36:58eric.snowsetfiles: + issue19711-test-case.diff
keywords: + patch
messages: + msg215108
2014-03-28 21:55:27eric.snowsetmessages: + msg215079
2013-11-23 19:53:41Arfreversetnosy: + Arfrever
2013-11-22 16:47:16brett.cannonlinkissue18864 dependencies
2013-11-22 16:47:07brett.cannoncreate