##// END OF EJS Templates
py3: byteify test-lock.py...
Matt Harbison -
r39984:5ee3146c default
parent child Browse files
Show More
@@ -2,19 +2,19 b' from __future__ import absolute_import'
2 2
3 3 import copy
4 4 import errno
5 import os
6 5 import silenttestrunner
7 6 import tempfile
8 7 import types
9 8 import unittest
10 9
11 10 from mercurial import (
11 encoding,
12 12 error,
13 13 lock,
14 14 vfs as vfsmod,
15 15 )
16 16
17 testlockname = 'testlock'
17 testlockname = b'testlock'
18 18
19 19 # work around http://bugs.python.org/issue1515
20 20 if types.MethodType not in copy._deepcopy_dispatch:
@@ -106,7 +106,7 b' class teststate(object):'
106 106
107 107 class testlock(unittest.TestCase):
108 108 def testlock(self):
109 state = teststate(self, tempfile.mkdtemp(dir=os.getcwd()))
109 state = teststate(self, tempfile.mkdtemp(dir=encoding.getcwd()))
110 110 lock = state.makelock()
111 111 state.assertacquirecalled(True)
112 112 lock.release()
@@ -115,7 +115,7 b' class testlock(unittest.TestCase):'
115 115 state.assertlockexists(False)
116 116
117 117 def testrecursivelock(self):
118 state = teststate(self, tempfile.mkdtemp(dir=os.getcwd()))
118 state = teststate(self, tempfile.mkdtemp(dir=encoding.getcwd()))
119 119 lock = state.makelock()
120 120 state.assertacquirecalled(True)
121 121
@@ -135,7 +135,7 b' class testlock(unittest.TestCase):'
135 135 state.assertlockexists(False)
136 136
137 137 def testlockfork(self):
138 state = teststate(self, tempfile.mkdtemp(dir=os.getcwd()))
138 state = teststate(self, tempfile.mkdtemp(dir=encoding.getcwd()))
139 139 lock = state.makelock()
140 140 state.assertacquirecalled(True)
141 141
@@ -154,7 +154,7 b' class testlock(unittest.TestCase):'
154 154 state.assertlockexists(False)
155 155
156 156 def testinheritlock(self):
157 d = tempfile.mkdtemp(dir=os.getcwd())
157 d = tempfile.mkdtemp(dir=encoding.getcwd())
158 158 parentstate = teststate(self, d)
159 159 parentlock = parentstate.makelock()
160 160 parentstate.assertacquirecalled(True)
@@ -184,7 +184,7 b' class testlock(unittest.TestCase):'
184 184 parentstate.assertlockexists(False)
185 185
186 186 def testmultilock(self):
187 d = tempfile.mkdtemp(dir=os.getcwd())
187 d = tempfile.mkdtemp(dir=encoding.getcwd())
188 188 state0 = teststate(self, d)
189 189 lock0 = state0.makelock()
190 190 state0.assertacquirecalled(True)
@@ -225,7 +225,7 b' class testlock(unittest.TestCase):'
225 225 lock0.release()
226 226
227 227 def testinheritlockfork(self):
228 d = tempfile.mkdtemp(dir=os.getcwd())
228 d = tempfile.mkdtemp(dir=encoding.getcwd())
229 229 parentstate = teststate(self, d)
230 230 parentlock = parentstate.makelock()
231 231 parentstate.assertacquirecalled(True)
@@ -253,7 +253,7 b' class testlock(unittest.TestCase):'
253 253 parentlock.release()
254 254
255 255 def testinheritcheck(self):
256 d = tempfile.mkdtemp(dir=os.getcwd())
256 d = tempfile.mkdtemp(dir=encoding.getcwd())
257 257 state = teststate(self, d)
258 258 def check():
259 259 raise error.LockInheritanceContractViolation('check failed')
@@ -273,7 +273,7 b' class testlock(unittest.TestCase):'
273 273 retrying 5 times.
274 274 """
275 275
276 d = tempfile.mkdtemp(dir=os.getcwd())
276 d = tempfile.mkdtemp(dir=encoding.getcwd())
277 277 state = teststate(self, d)
278 278
279 279 def emulatefrequentlock(*args):
General Comments 0
You need to be logged in to leave comments. Login now