def main_pyannotate(): try: collect_types.init_types_collection() collect_types.resume() return main() finally: log.info("dumping type_info") collect_types.pause() collect_types.dump_stats('type_info.json')
def main_annotate(): from pyannotate_runtime import collect_types collect_types.init_types_collection(filter_filename=filter_filename) collect_types.resume() try: manager.run() except BaseException: pass collect_types.dump_stats(b"type_info.json")
def collecting_types(self): # type: () -> Iterator[None] collect_types.collected_args = {} collect_types.collected_signatures = {} collect_types.num_samples = {} collect_types.sampling_counters = {} collect_types.call_pending = set() collect_types.resume() yield None collect_types.pause() self.load_stats()
def beforeTest(self, *args, **kwargs): collect_types.resume()
def collect_types_fixture(): from pyannotate_runtime import collect_types collect_types.resume() yield collect_types.pause()
def only_return(x): # type: (int) -> str collect_types.resume() return ''
def pytest_runtest_call(self): """Handle the pytest hook event that a test is about to be run: start type collection.""" collect_types.resume()
def collect_types_fixture(): collect_types.resume() yield collect_types.pause()
#!/usr/bin/env python3 from auth import main from pyannotate_runtime import collect_types if __name__ == '__main__': collect_types.init_types_collection() collect_types.resume() main() collect_types.pause() collect_types.dump_stats('type_info.json')