diff options
| author | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 23:15:27 -0500 |
|---|---|---|
| committer | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 23:15:27 -0500 |
| commit | 09abd97dbb66cc4528e2e9344499dd0cdb282d76 (patch) | |
| tree | ed86c67fb6746b411c72e697e862d58056afd24f /tests/test_progress_dashboard.py | |
| parent | 9711e54c0cf8735a926ad1114cd26074f1d94049 (diff) | |
| parent | 9fc6b263e459526f6646855a0444d95ecf9bbe21 (diff) | |
Merge pull request #4515 from Silent
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_progress_dashboard.py')
| -rw-r--r-- | tests/test_progress_dashboard.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_progress_dashboard.py b/tests/test_progress_dashboard.py index 169146897..e4d4eee67 100644 --- a/tests/test_progress_dashboard.py +++ b/tests/test_progress_dashboard.py | |||
| @@ -133,6 +133,21 @@ class Tests(unittest.TestCase): | |||
| 133 | self.assertIn("__main__", text) | 133 | self.assertIn("__main__", text) |
| 134 | self.assertIsNone(pd.PYTEST_MARKERS.search(text)) | 134 | self.assertIsNone(pd.PYTEST_MARKERS.search(text)) |
| 135 | 135 | ||
| 136 | def test_unlistable_subfolder_raises_instead_of_a_partial_scan(self): | ||
| 137 | # os.walk skips a directory it cannot list unless onerror raises; the selection and the digest | ||
| 138 | # used to silently drop the sub-folder and report the rest as complete. | ||
| 139 | def walk(top, onerror=None, **kwargs): | ||
| 140 | if onerror is not None: | ||
| 141 | onerror(PermissionError(13, "Permission denied", os.path.join(top, "locked"))) | ||
| 142 | return | ||
| 143 | yield # pragma: no cover | ||
| 144 | |||
| 145 | with mock.patch.object(pd.os, "walk", side_effect=walk): | ||
| 146 | with self.assertRaises(PermissionError): | ||
| 147 | pd.ci_test_files() | ||
| 148 | with self.assertRaises(PermissionError): | ||
| 149 | pd.code_digest() | ||
| 150 | |||
| 136 | 151 | ||
| 137 | class Freshness(unittest.TestCase): | 152 | class Freshness(unittest.TestCase): |
| 138 | def collect(self, results): | 153 | def collect(self, results): |