Skip to content

Commit feeccf8

Browse files
Copiloteleanorjboyd
andcommitted
Return empty string instead of asterisk when class line cannot be determined
Changed get_class_line() to return "" instead of "*" when inspect.getsourcelines() fails, making it consistent with the pytest implementation and leaving the field blank when the line number cannot be determined. Co-authored-by: eleanorjboyd <[email protected]>
1 parent e22f3c3 commit feeccf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python_files/unittestadapter/pvsc_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def get_class_line(test_case: unittest.TestCase) -> str:
109109
_sourcelines, lineno = inspect.getsourcelines(test_class)
110110
return str(lineno)
111111
except Exception:
112-
return "*"
112+
return ""
113113

114114

115115
def get_source_line(obj) -> str:

0 commit comments

Comments
 (0)