Undocumented
Function | assert_equal |
Undocumented |
Function | assert_module_equivalence |
Undocumented |
Function | assert_string_arrays_equal |
Assert that two string arrays are equal. |
Function | assert_target_equivalence |
Compare actual and expected targets (order sensitive). |
Function | assert_type |
Undocumented |
Function | check_test_output_files |
Undocumented |
Function | clean_up |
Remove common directory prefix from all strings in a. |
Function | good_repr |
Undocumented |
Function | local_sys_path_set |
Temporary insert current directory into sys.path. |
Function | normalize_error_messages |
Translate an array of error messages to use / as path separator. |
Function | normalize_file_output |
Normalize file output for comparison. |
Function | num_skipped_prefix_lines |
Undocumented |
Function | num_skipped_suffix_lines |
Undocumented |
Function | parse_options |
Parse comments like '# flags: --foo' in a test case. |
Function | perform_file_operations |
Undocumented |
Function | retry_on_error |
Retry callback with exponential backoff when it raises OSError. |
Function | run_mypy |
Undocumented |
Function | show_align_message |
Align s1 and s2 so that the their first difference is highlighted. |
Function | split_lines |
Returns a single list of string lines from the byte streams in args. |
Function | testcase_pyversion |
Undocumented |
Function | testfile_pyversion |
Undocumented |
Function | typename |
Undocumented |
Function | update_testcase_output |
Undocumented |
Function | write_and_fudge_mtime |
Undocumented |
Constant | MIN_LINE_LENGTH_FOR_ALIGNMENT |
Undocumented |
Undocumented
Parameters | |
name:str | Undocumented |
expected:Iterable[ | Undocumented |
actual:Iterable[ | Undocumented |
Assert that two string arrays are equal.
We consider "can't" and "cannot" equivalent, by replacing the former with the latter before comparing.
Display any differences in a human-readable form.
Parameters | |
expected:List[ | Undocumented |
actual:List[ | Undocumented |
msg:str | Undocumented |
Parameters | |
name:str | Undocumented |
expected:List[ | Undocumented |
actual:List[ | Undocumented |
Undocumented
Parameters | |
testcase:DataDrivenTestCase | Undocumented |
step:int | Undocumented |
strip_prefix:str | Undocumented |
Remove common directory prefix from all strings in a.
This uses a naive string replace; it seems to work well enough. Also remove trailing carriage returns.
Parameters | |
a:List[ | Undocumented |
Returns | |
List[ | Undocumented |
Temporary insert current directory into sys.path.
This can be used by test cases that do runtime imports, for example by the stubgen tests.
Returns | |
Iterator[ | Undocumented |
Parameters | |
messages:List[ | Undocumented |
Returns | |
List[ | Undocumented |
Parameters | |
content:List[ | Undocumented |
current_abs_path:str | Undocumented |
Returns | |
List[ | Undocumented |
Parameters | |
program_text:str | Undocumented |
testcase:DataDrivenTestCase | Undocumented |
incremental_step:int | Undocumented |
Returns | |
Options | Undocumented |
Retry callback with exponential backoff when it raises OSError.
If the function still generates an error after max_wait seconds, propagate the exception.
This can be effective against random file system operation failures on Windows.
Parameters | |
func:Callable[ | Undocumented |
max_wait:float | Undocumented |
Align s1 and s2 so that the their first difference is highlighted.
For example, if s1 is 'foobar' and s2 is 'fobar', display the following lines:
E: foobar A: fobar
^
If s1 and s2 are long, only display a fragment of the strings around the first difference. If s1 is very short, do nothing.
Parameters | |
s1:str | Undocumented |
s2:str | Undocumented |
Parameters | |
*streams:bytes | Undocumented |
Returns | |
List[ | Undocumented |
Undocumented
Parameters | |
path:str | Undocumented |
testcase_name:str | Undocumented |
Returns | |
Tuple[ | Undocumented |