Open DrCash-KMark opened 2 years ago
When testing the arrays in test_array I cannot redirect the output. I always get the "OSError: [WinError 6] The handle is invalid" error.
The code I used:
def test_print_intervals(self): interval_list = [[1, 3], [2, 6], [8, 10], [15, 18]] capturedOutput = io.StringIO() # Create StringIO object sys.stdout = capturedOutput # and redirect stdout. Interval.print_intervals(interval_list) # Call unchanged function. sys.stdout = sys.__stdout__ # Reset redirect.
source: https://stackoverflow.com/questions/33767627/python-write-unittest-for-console-print
When testing the arrays in test_array I cannot redirect the output. I always get the "OSError: [WinError 6] The handle is invalid" error.
The code I used:
source: https://stackoverflow.com/questions/33767627/python-write-unittest-for-console-print