def _getPreludeSegments(self, testID):
        """
        Return a list of all non-leaf segments to display in the tree.

        Normally this is the module and class name.
        """
        segments = testID.split('.')[:-1]
        if len(segments) == 0:
            return segments
        segments = [
            seg for seg in ('.'.join(segments[:-1]), segments[-1])
            if len(seg) > 0]
        return segments

        Return a list of all non-leaf segments to display in the tree.

        Normally this is the module and class name.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/reporter.py