cpython: c22ec7a45114 (original) (raw)

Mercurial > cpython

changeset 101292:c22ec7a45114

Fixes #19711: Add tests for reloading namespace packages. [#19711]

Eric Snow ericsnowcurrently@gmail.com
date Tue, 10 May 2016 15:29:05 -0600
parents 909099686e6e
children 3c75707045f5
files Lib/test/test_importlib/test_namespace_pkgs.py Misc/NEWS
diffstat 2 files changed, 35 insertions(+), 1 deletions(-)[+] [-] Lib/test/test_importlib/test_namespace_pkgs.py 34 Misc/NEWS 2

line wrap: on

line diff

--- a/Lib/test/test_importlib/test_namespace_pkgs.py +++ b/Lib/test/test_importlib/test_namespace_pkgs.py @@ -1,4 +1,5 @@ import contextlib +import importlib import os import sys import unittest @@ -67,6 +68,7 @@ class NamespacePackageTest(unittest.Test # TODO: will we ever want to pass exc_info to exit? self.ctx.exit(None, None, None) + class SingleNamespacePackage(NamespacePackageTest): paths = ['portion1'] @@ -83,7 +85,7 @@ class SingleNamespacePackage(NamespacePa self.assertEqual(repr(foo), "<module 'foo' (namespace)>") -class DynamicPatheNamespacePackage(NamespacePackageTest): +class DynamicPathNamespacePackage(NamespacePackageTest): paths = ['portion1'] def test_dynamic_path(self): @@ -285,5 +287,35 @@ class ModuleAndNamespacePackageInSameDir self.assertEqual(a_test.attr, 'in module') +class ReloadTests(NamespacePackageTest):

+

+

+

+

+

+ + if name == "main": unittest.main()

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -52,6 +52,8 @@ Core and Builtins