buggy_script.py•1.21 kB
"""
Sample script for integration testing.
This script has multiple breakpoint locations for testing
the debugger's ability to pause and capture locals.
"""
def calculate_sum(numbers):
"""Calculate sum with multiple variables to inspect."""
total = 0
for num in numbers:
total += num # Breakpoint location 1: line 13
return total
def process_data(items):
"""Process items with intermediate steps."""
doubled = [x * 2 for x in items] # Breakpoint location 2: line 22
return doubled
def main():
"""Main function with test data."""
data = [1, 2, 3, 4, 5]
result = calculate_sum(data) # Breakpoint location 3: line 28
print(f"Sum: {result}")
# Process the data
processed = process_data(data) # Breakpoint location 4: line 32
print(f"Processed: {processed}")
# Additional calculations
final_value = result * 2 # Breakpoint location 5: line 36
print(f"Final: {final_value}")
# Test with dictionary
config = {"mode": "debug", "level": 2} # Breakpoint location 6: line 40
print(f"Config: {config}")
return final_value
if __name__ == "__main__":
exit_code = main()
print(f"Exit code: {exit_code}")