Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4626)

Side by Side Diff: Lib/test/test_importlib/test_spec.py

Issue 23014: Don't have importlib.abc.Loader.create_module() be optional
Patch Set: Created 4 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 from . import util as test_util 1 from . import util as test_util
2 2
3 init = test_util.import_importlib('importlib') 3 init = test_util.import_importlib('importlib')
4 machinery = test_util.import_importlib('importlib.machinery') 4 machinery = test_util.import_importlib('importlib.machinery')
5 util = test_util.import_importlib('importlib.util') 5 util = test_util.import_importlib('importlib.util')
6 6
7 import os.path 7 import os.path
8 from test.support import CleanImport 8 from test.support import CleanImport
9 import unittest 9 import unittest
10 import sys 10 import sys
(...skipping 15 matching lines...) Expand all
26 return self._get_filename 26 return self._get_filename
27 if name == 'is_package': 27 if name == 'is_package':
28 return self._is_package 28 return self._is_package
29 raise AttributeError(name) 29 raise AttributeError(name)
30 30
31 def _get_filename(self, name): 31 def _get_filename(self, name):
32 return self.path 32 return self.path
33 33
34 def _is_package(self, name): 34 def _is_package(self, name):
35 return self.package 35 return self.package
36
37 def create_module(self, spec):
38 return None
36 39
37 40
38 class NewLoader(TestLoader): 41 class NewLoader(TestLoader):
39 42
40 EGGS = 1 43 EGGS = 1
41 44
42 def exec_module(self, module): 45 def exec_module(self, module):
43 module.eggs = self.EGGS 46 module.eggs = self.EGGS
44 47
45 48
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 self.assertTrue(spec.has_location) 804 self.assertTrue(spec.has_location)
802 805
803 806
804 (Frozen_FactoryTests, 807 (Frozen_FactoryTests,
805 Source_FactoryTests 808 Source_FactoryTests
806 ) = test_util.test_both(FactoryTests, util=util, machinery=machinery) 809 ) = test_util.test_both(FactoryTests, util=util, machinery=machinery)
807 810
808 811
809 if __name__ == '__main__': 812 if __name__ == '__main__':
810 unittest.main() 813 unittest.main()
OLDNEW

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+