Issue #18864: Add a setter for ModuleSpec.has_location.

This commit is contained in:
Eric Snow 2013-12-10 22:16:41 -07:00
parent 85cce1eac7
commit b282b3d804
5 changed files with 2942 additions and 2920 deletions

View file

@ -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,