MCPcopy Index your code
hub / github.com/python/mypy / build

Method build

mypy/test/testmerge.py:97–121  ·  view source on GitHub ↗
(self, source: str, testcase: DataDrivenTestCase)

Source from the content-addressed store, hash-verified

95 )
96
97 def build(self, source: str, testcase: DataDrivenTestCase) -> BuildResult | None:
98 options = parse_options(source, testcase, incremental_step=1)
99 options.incremental = True
100 options.fine_grained_incremental = True
101 options.use_builtins_fixtures = True
102 options.export_types = True
103 options.show_traceback = True
104 options.allow_empty_bodies = True
105 options.reveal_verbose_types = True
106 main_path = os.path.join(test_temp_dir, "main")
107
108 self.str_conv.options = options
109 self.type_str_conv.options = options
110 with open(main_path, "w", encoding="utf8") as f:
111 f.write(source)
112 try:
113 result = build.build(
114 sources=[BuildSource(main_path, None, None)],
115 options=options,
116 alt_lib_path=test_temp_dir,
117 )
118 except CompileError:
119 # TODO: Is it okay to return None?
120 return None
121 return result
122
123 def build_increment(
124 self, manager: FineGrainedBuildManager, module_id: str, path: str

Callers 1

run_caseMethod · 0.95

Calls 4

parse_optionsFunction · 0.90
BuildSourceClass · 0.90
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected