@@ -119,8 +119,8 @@ def __init__(
119119 name : str ,
120120 type : str ,
121121 source : Optional [str ],
122- line : int ,
123- column : int = 1 ,
122+ line : Optional [ int ] ,
123+ column : Optional [ int ] = None ,
124124 handler : Any = None ,
125125 is_file : bool = True ,
126126 libname : Optional [str ] = None ,
@@ -591,7 +591,7 @@ def add_stackframe_entry(
591591 type : str ,
592592 source : Optional [str ],
593593 line : Optional [int ],
594- column : Optional [int ] = 1 ,
594+ column : Optional [int ] = None ,
595595 * ,
596596 handler : Any = None ,
597597 libname : Optional [str ] = None ,
@@ -615,8 +615,8 @@ def add_stackframe_entry(
615615 name ,
616616 type ,
617617 source ,
618- line if line is not None else 0 ,
619- column if column is not None else 0 ,
618+ line ,
619+ column ,
620620 handler = handler ,
621621 is_file = is_file ,
622622 libname = libname ,
@@ -690,7 +690,7 @@ def start_suite(self, name: str, attributes: Dict[str, Any]) -> None:
690690
691691 self .wait_for_running ()
692692 elif entry .source :
693- self .process_start_state (entry .source , entry .line , entry .type , status )
693+ self .process_start_state (entry .source , entry .line if entry . line is not None else 0 , entry .type , status )
694694
695695 self .wait_for_running ()
696696
@@ -722,7 +722,7 @@ def start_test(self, name: str, attributes: Dict[str, Any]) -> None:
722722 entry = self .add_stackframe_entry (name , type , source , line_no , longname = longname )
723723
724724 if self .debug and entry .source :
725- self .process_start_state (entry .source , entry .line , entry .type , status )
725+ self .process_start_state (entry .source , entry .line if entry . line is not None else 0 , entry .type , status )
726726
727727 self .wait_for_running ()
728728
@@ -749,7 +749,7 @@ def start_keyword(self, name: str, attributes: Dict[str, Any]) -> None:
749749
750750 status = attributes .get ("status" , "" )
751751 source = attributes .get ("source" , None )
752- line_no = attributes .get ("lineno" , 1 )
752+ line_no = attributes .get ("lineno" , None )
753753 type = attributes .get ("type" , "KEYWORD" )
754754 libname = attributes .get ("libname" , None )
755755 kwname = attributes .get ("kwname" , None )
@@ -770,7 +770,7 @@ def start_keyword(self, name: str, attributes: Dict[str, Any]) -> None:
770770 if status == "NOT RUN" and type not in ["IF" ]:
771771 return
772772
773- if self .debug and entry .source :
773+ if self .debug and entry .source and entry . line is not None :
774774 self .process_start_state (entry .source , entry .line , entry .type , status )
775775
776776 self .wait_for_running ()
@@ -791,7 +791,7 @@ def end_keyword(self, name: str, attributes: Dict[str, Any]) -> None:
791791 )
792792
793793 source = attributes .get ("source" , None )
794- line_no = attributes .get ("lineno" , 1 )
794+ line_no = attributes .get ("lineno" , None )
795795 type = attributes .get ("type" , "KEYWORD" )
796796 kwname = attributes .get ("kwname" , None )
797797
@@ -836,8 +836,8 @@ def yield_stack() -> Generator[StackFrame, None, None]:
836836 yield StackFrame (
837837 id = v .id ,
838838 name = v .longname or v .kwname or v .name or v .type ,
839- line = v .stack_frames [0 ].line ,
840- column = v .stack_frames [0 ].column ,
839+ line = v .stack_frames [0 ].line if v . stack_frames [ 0 ]. line is not None else 0 ,
840+ column = v .stack_frames [0 ].column if v . stack_frames [ 0 ]. column is not None else 1 ,
841841 source = source_from_entry (v .stack_frames [0 ]),
842842 presentation_hint = "normal" if v .stack_frames [0 ].is_file else "subtle" ,
843843 module_id = v .libname ,
@@ -846,8 +846,8 @@ def yield_stack() -> Generator[StackFrame, None, None]:
846846 yield StackFrame (
847847 id = v .id ,
848848 name = v .longname or v .kwname or v .name or v .type ,
849- line = v .line ,
850- column = v .column ,
849+ line = v .line if v . line is not None else 1 ,
850+ column = v .column if v . column is not None else 1 ,
851851 source = source_from_entry (v ),
852852 presentation_hint = "normal" if v .is_file else "subtle" ,
853853 module_id = v .libname ,
@@ -873,7 +873,7 @@ def log_message(self, message: Dict[str, Any]) -> None:
873873 output = "LOG> {timestamp} {level}: {message}\n " .format (** message ),
874874 category = OutputCategory .CONSOLE ,
875875 source = source ,
876- line = line ,
876+ line = line if line is not None else 0 ,
877877 column = 0 if source is not None else None ,
878878 )
879879 ),
0 commit comments