tests: fix failing doctest in match.py by adding dummy auditor
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 27 Dec 2019 09:55:35 -0800
changeset 44002 d9d78e70149a
parent 44001 faf00e30b63f
child 44003 cb2e2b095dc9
tests: fix failing doctest in match.py by adding dummy auditor It was failing with "OSError: [Errno 13] Permission denied: '/root/sub'". It has been failing since 8b1a9ba375e5 (match: make sure `root` argument is always an absolute path (API), 2019-12-13). I don't know why I didn't notice it before sending that patch. Differential Revision: https://phab.mercurial-scm.org/D7731
mercurial/match.py
--- a/mercurial/match.py	Thu Jan 02 17:30:27 2020 -0800
+++ b/mercurial/match.py	Fri Dec 27 09:55:35 2019 -0800
@@ -945,7 +945,7 @@
     The paths are remapped to remove/insert the path as needed:
 
     >>> from . import pycompat
-    >>> m1 = match(util.localpath(b'/root'), b'', [b'a.txt', b'sub/b.txt'])
+    >>> m1 = match(util.localpath(b'/root'), b'', [b'a.txt', b'sub/b.txt'], auditor=lambda name: None)
     >>> m2 = subdirmatcher(b'sub', m1)
     >>> m2(b'a.txt')
     False