Patchwork [09,of,14] test-lock: manually disable path auditing after vfs creation

login
register
mail settings
Submitter Pierre-Yves David
Date July 2, 2017, 2:56 a.m.
Message ID <d15514b41d39ddf23018.1498964194@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21890/
State Accepted
Headers show

Comments

Pierre-Yves David - July 2, 2017, 2:56 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1498959433 -7200
#      Sun Jul 02 03:37:13 2017 +0200
# Node ID d15514b41d39ddf23018787f5946f1df85458eaf
# Parent  5dd9c2cb6d1dbebc0a51662dd8dda9d4c3f933db
# EXP-Topic vfs.ward
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r d15514b41d39
test-lock: manually disable path auditing after vfs creation

The 'audit' parameter of the 'vfs' constructor has very few users. 'test-lock'
is one of the two left. Since it is a test, it seems fine to apply the no-audit
manually here.

This will let us simplify the 'vfs' constructor in a later changeset.

Patch

diff --git a/tests/test-lock.py b/tests/test-lock.py
--- a/tests/test-lock.py
+++ b/tests/test-lock.py
@@ -11,6 +11,7 @@  import unittest
 from mercurial import (
     error,
     lock,
+    util,
     vfs as vfsmod,
 )
 
@@ -37,7 +38,9 @@  class teststate(object):
         self._acquirecalled = False
         self._releasecalled = False
         self._postreleasecalled = False
-        self.vfs = vfsmod.vfs(dir, audit=False)
+        self.vfs = vfsmod.vfs(dir)
+        # disable path auditing for the test
+        self.vfs.audit = util.always
         self._pidoffset = pidoffset
 
     def makelock(self, *args, **kwargs):