upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/test_progress_dashboard.py
diff options
context:
space:
mode:
authorSilent <103598001+SebSilent@users.noreply.github.com>2026-11-22 22:58:17 -0300
committerSilent <103598001+SebSilent@users.noreply.github.com>2026-11-22 22:58:17 -0300
commit9fc6b263e459526f6646855a0444d95ecf9bbe21 (patch)
tree6461da3bc68b407ba5697015c1daa9f1b703e992 /tests/test_progress_dashboard.py
parent03b09a086592a197db64d91655c6e65c30764d96 (diff)
progress_dashboard: fail on an unlistable sub-folder instead of a partial test selection or code digest
Diffstat (limited to 'tests/test_progress_dashboard.py')
-rw-r--r--tests/test_progress_dashboard.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_progress_dashboard.py b/tests/test_progress_dashboard.py
index dfa5e8e9c..caf1c7b3e 100644
--- a/tests/test_progress_dashboard.py
+++ b/tests/test_progress_dashboard.py
@@ -11,6 +11,7 @@ import subprocess
11import sys 11import sys
12import tempfile 12import tempfile
13import unittest 13import unittest
14from unittest import mock
14 15
15HERE = os.path.dirname(os.path.abspath(__file__)) 16HERE = os.path.dirname(os.path.abspath(__file__))
16ROOT = os.path.dirname(HERE) 17ROOT = os.path.dirname(HERE)
@@ -82,6 +83,21 @@ class Tests(unittest.TestCase):
82 self.assertIn("__main__", text) 83 self.assertIn("__main__", text)
83 self.assertIsNone(pd.PYTEST_MARKERS.search(text)) 84 self.assertIsNone(pd.PYTEST_MARKERS.search(text))
84 85
86 def test_unlistable_subfolder_raises_instead_of_a_partial_scan(self):
87 # os.walk skips a directory it cannot list unless onerror raises; the selection and the digest
88 # used to silently drop the sub-folder and report the rest as complete.
89 def walk(top, onerror=None, **kwargs):
90 if onerror is not None:
91 onerror(PermissionError(13, "Permission denied", os.path.join(top, "locked")))
92 return
93 yield # pragma: no cover
94
95 with mock.patch.object(pd.os, "walk", side_effect=walk):
96 with self.assertRaises(PermissionError):
97 pd.ci_test_files()
98 with self.assertRaises(PermissionError):
99 pd.code_digest()
100
85 101
86class Freshness(unittest.TestCase): 102class Freshness(unittest.TestCase):
87 def collect(self, results): 103 def collect(self, results):