Ejemplo n.º 1
0
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')
Ejemplo n.º 2
0
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")
Ejemplo n.º 3
0
 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()
Ejemplo n.º 4
0
 def beforeTest(self, *args, **kwargs):
     collect_types.resume()
Ejemplo n.º 5
0
 def collect_types_fixture():
     from pyannotate_runtime import collect_types
     collect_types.resume()
     yield
     collect_types.pause()
Ejemplo n.º 6
0
 def only_return(x):
     # type: (int) -> str
     collect_types.resume()
     return ''
Ejemplo n.º 7
0
 def pytest_runtest_call(self):
     """Handle the pytest hook event that a test is about to be run: start type collection."""
     collect_types.resume()
Ejemplo n.º 8
0
def collect_types_fixture():
    collect_types.resume()
    yield
    collect_types.pause()
Ejemplo n.º 9
0
#!/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')