diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2013-12-11 05:16:41 (GMT) |
---|---|---|
committer | Eric Snow <ericsnowcurrently@gmail.com> | 2013-12-11 05:16:41 (GMT) |
commit | b282b3d804165d704130fabf0f609d5dd46c1ed2 (patch) | |
tree | 99d46706ace4b5596f64302170e52b066c484463 /Lib/test/test_importlib | |
parent | 85cce1eac7a130412e7673208494f30c04bf4b33 (diff) | |
download | cpython-b282b3d804165d704130fabf0f609d5dd46c1ed2.zip cpython-b282b3d804165d704130fabf0f609d5dd46c1ed2.tar.gz cpython-b282b3d804165d704130fabf0f609d5dd46c1ed2.tar.bz2 |
Issue #18864: Add a setter for ModuleSpec.has_location.
Diffstat (limited to 'Lib/test/test_importlib')
-rw-r--r-- | Lib/test/test_importlib/test_spec.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_spec.py b/Lib/test/test_importlib/test_spec.py index 8880ffc..2af47f4 100644 --- a/Lib/test/test_importlib/test_spec.py +++ b/Lib/test/test_importlib/test_spec.py @@ -116,6 +116,13 @@ class ModuleSpecTests: self.assertIs(spec.cached, None) self.assertFalse(spec.has_location) + def test_has_location_setter(self): + spec = self.machinery.ModuleSpec(self.name, self.loader, + origin='somewhere') + self.assertFalse(spec.has_location) + spec.has_location = True + self.assertTrue(spec.has_location) + def test_equality(self): other = type(sys.implementation)(name=self.name, loader=self.loader, |