예제 #1
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.start()
     yield None
     collect_types.stop()
     self.load_stats()
예제 #2
0
def annotations_collect():
    """Fixture to collect 'annotations' for pyannonate

    Yields:
        [None]: [Generates file annotations.txt]
    """
    # pipx install pyannotate==1.2.0
    from pyannotate_runtime import collect_types

    collect_types.init_types_collection()
    collect_types.start()
    yield None
    collect_types.stop()
    collect_types.dump_stats("annotations.txt")
예제 #3
0
 def only_return(x):
     # type: (int) -> str
     collect_types.start()
     return ''