Mercurial > public > mercurial-scm > hg-stable
comparison tests/test-verify-repo-operations.py @ 53031:e705fec4a03f stable
branching: merging with 7.0 changes
Since 6.9.3 was made after 7.0rc0 we need to deal with more branching than
usual.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 05 Mar 2025 23:02:19 +0100 |
parents | 3e84e001b6c1 |
children |
comparison
equal
deleted
inserted
replaced
53030:74439d1cbeba | 53031:e705fec4a03f |
---|---|
166 contents = Bundle('contents') | 166 contents = Bundle('contents') |
167 branches = Bundle('branches') | 167 branches = Bundle('branches') |
168 committimes = Bundle('committimes') | 168 committimes = Bundle('committimes') |
169 | 169 |
170 def __init__(self): | 170 def __init__(self): |
171 super(verifyingstatemachine, self).__init__() | 171 super().__init__() |
172 self.repodir = os.path.join(testtmp, "repos") | 172 self.repodir = os.path.join(testtmp, "repos") |
173 if os.path.exists(self.repodir): | 173 if os.path.exists(self.repodir): |
174 shutil.rmtree(self.repodir) | 174 shutil.rmtree(self.repodir) |
175 os.chdir(testtmp) | 175 os.chdir(testtmp) |
176 self.log = [] | 176 self.log = [] |
190 do some additional testing: We generate a .t file based on our test | 190 do some additional testing: We generate a .t file based on our test |
191 run using run-test.py -i to get the correct output. | 191 run using run-test.py -i to get the correct output. |
192 | 192 |
193 We then test it in a number of other configurations, verifying that | 193 We then test it in a number of other configurations, verifying that |
194 each passes the same test.""" | 194 each passes the same test.""" |
195 super(verifyingstatemachine, self).teardown() | 195 super().teardown() |
196 try: | 196 try: |
197 shutil.rmtree(self.repodir) | 197 shutil.rmtree(self.repodir) |
198 except OSError: | 198 except OSError: |
199 pass | 199 pass |
200 ttest = os.linesep.join(" " + l for l in self.log) | 200 ttest = os.linesep.join(" " + l for l in self.log) |
208 stdin=subprocess.PIPE, | 208 stdin=subprocess.PIPE, |
209 stdout=devnull, | 209 stdout=devnull, |
210 stderr=devnull, | 210 stderr=devnull, |
211 ) | 211 ) |
212 rewriter.communicate("yes") | 212 rewriter.communicate("yes") |
213 with open(path, 'r') as i: | 213 with open(path) as i: |
214 ttest = i.read() | 214 ttest = i.read() |
215 | 215 |
216 e = None | 216 e = None |
217 if not self.failed: | 217 if not self.failed: |
218 try: | 218 try: |
231 l = l.replace( | 231 l = l.replace( |
232 "--config %s=" % (extensionconfigkey(ext),), | 232 "--config %s=" % (extensionconfigkey(ext),), |
233 "", | 233 "", |
234 ) | 234 ) |
235 o.write(l + os.linesep) | 235 o.write(l + os.linesep) |
236 with open(tf, 'r') as r: | 236 with open(tf) as r: |
237 t = r.read() | 237 t = r.read() |
238 assert ext not in t, t | 238 assert ext not in t, t |
239 output = subprocess.check_output( | 239 output = subprocess.check_output( |
240 [ | 240 [ |
241 runtests, | 241 runtests, |
253 if e is not None: | 253 if e is not None: |
254 raise e | 254 raise e |
255 | 255 |
256 def execute_step(self, step): | 256 def execute_step(self, step): |
257 try: | 257 try: |
258 return super(verifyingstatemachine, self).execute_step(step) | 258 return super().execute_step(step) |
259 except (HypothesisException, KeyboardInterrupt): | 259 except (HypothesisException, KeyboardInterrupt): |
260 raise | 260 raise |
261 except Exception: | 261 except Exception: |
262 self.failed = True | 262 self.failed = True |
263 raise | 263 raise |