@@ -119,8 +119,8 @@ def __init__(
119
119
name : str ,
120
120
type : str ,
121
121
source : Optional [str ],
122
- line : int ,
123
- column : int = 1 ,
122
+ line : Optional [ int ] ,
123
+ column : Optional [ int ] = None ,
124
124
handler : Any = None ,
125
125
is_file : bool = True ,
126
126
libname : Optional [str ] = None ,
@@ -591,7 +591,7 @@ def add_stackframe_entry(
591
591
type : str ,
592
592
source : Optional [str ],
593
593
line : Optional [int ],
594
- column : Optional [int ] = 1 ,
594
+ column : Optional [int ] = None ,
595
595
* ,
596
596
handler : Any = None ,
597
597
libname : Optional [str ] = None ,
@@ -615,8 +615,8 @@ def add_stackframe_entry(
615
615
name ,
616
616
type ,
617
617
source ,
618
- line if line is not None else 0 ,
619
- column if column is not None else 0 ,
618
+ line ,
619
+ column ,
620
620
handler = handler ,
621
621
is_file = is_file ,
622
622
libname = libname ,
@@ -690,7 +690,7 @@ def start_suite(self, name: str, attributes: Dict[str, Any]) -> None:
690
690
691
691
self .wait_for_running ()
692
692
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 )
694
694
695
695
self .wait_for_running ()
696
696
@@ -722,7 +722,7 @@ def start_test(self, name: str, attributes: Dict[str, Any]) -> None:
722
722
entry = self .add_stackframe_entry (name , type , source , line_no , longname = longname )
723
723
724
724
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 )
726
726
727
727
self .wait_for_running ()
728
728
@@ -749,7 +749,7 @@ def start_keyword(self, name: str, attributes: Dict[str, Any]) -> None:
749
749
750
750
status = attributes .get ("status" , "" )
751
751
source = attributes .get ("source" , None )
752
- line_no = attributes .get ("lineno" , 1 )
752
+ line_no = attributes .get ("lineno" , None )
753
753
type = attributes .get ("type" , "KEYWORD" )
754
754
libname = attributes .get ("libname" , None )
755
755
kwname = attributes .get ("kwname" , None )
@@ -770,7 +770,7 @@ def start_keyword(self, name: str, attributes: Dict[str, Any]) -> None:
770
770
if status == "NOT RUN" and type not in ["IF" ]:
771
771
return
772
772
773
- if self .debug and entry .source :
773
+ if self .debug and entry .source and entry . line is not None :
774
774
self .process_start_state (entry .source , entry .line , entry .type , status )
775
775
776
776
self .wait_for_running ()
@@ -791,7 +791,7 @@ def end_keyword(self, name: str, attributes: Dict[str, Any]) -> None:
791
791
)
792
792
793
793
source = attributes .get ("source" , None )
794
- line_no = attributes .get ("lineno" , 1 )
794
+ line_no = attributes .get ("lineno" , None )
795
795
type = attributes .get ("type" , "KEYWORD" )
796
796
kwname = attributes .get ("kwname" , None )
797
797
@@ -836,8 +836,8 @@ def yield_stack() -> Generator[StackFrame, None, None]:
836
836
yield StackFrame (
837
837
id = v .id ,
838
838
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 ,
841
841
source = source_from_entry (v .stack_frames [0 ]),
842
842
presentation_hint = "normal" if v .stack_frames [0 ].is_file else "subtle" ,
843
843
module_id = v .libname ,
@@ -846,8 +846,8 @@ def yield_stack() -> Generator[StackFrame, None, None]:
846
846
yield StackFrame (
847
847
id = v .id ,
848
848
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 ,
851
851
source = source_from_entry (v ),
852
852
presentation_hint = "normal" if v .is_file else "subtle" ,
853
853
module_id = v .libname ,
@@ -873,7 +873,7 @@ def log_message(self, message: Dict[str, Any]) -> None:
873
873
output = "LOG> {timestamp} {level}: {message}\n " .format (** message ),
874
874
category = OutputCategory .CONSOLE ,
875
875
source = source ,
876
- line = line ,
876
+ line = line if line is not None else 0 ,
877
877
column = 0 if source is not None else None ,
878
878
)
879
879
),
0 commit comments