Check if a test is up-to-date, ignoring RustPython TODO markers.
(test_name: str, cpython_prefix: str, lib_prefix: str)
| 185 | |
| 186 | |
| 187 | def is_test_up_to_date(test_name: str, cpython_prefix: str, lib_prefix: str) -> bool: |
| 188 | """Check if a test is up-to-date, ignoring RustPython TODO markers.""" |
| 189 | cpython_path = _get_cpython_test_path(test_name, cpython_prefix) |
| 190 | if cpython_path is None: |
| 191 | return True |
| 192 | |
| 193 | local_path = _get_local_test_path(cpython_path, lib_prefix) |
| 194 | if not local_path.exists(): |
| 195 | return False |
| 196 | |
| 197 | if cpython_path.is_file(): |
| 198 | return compare_file_contents( |
| 199 | cpython_path, local_path, local_filter=filter_rustpython_todo |
| 200 | ) |
| 201 | |
| 202 | return compare_dir_contents( |
| 203 | cpython_path, local_path, local_filter=filter_rustpython_todo |
| 204 | ) |
| 205 | |
| 206 | |
| 207 | def count_test_todos(test_name: str, lib_prefix: str) -> int: |
no test coverage detected