Mercurial > public > mercurial-scm > hg
comparison tests/test-verify-repo-operations.py @ 52643:5cc8deb96b48
pyupgrade: modernize calls to superclass methods
This is the `legacy` fixer in `pyupgrade`, with the loop yielding the offset of
`yield` statements commented out.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 05 Jan 2025 22:23:31 -0500 |
parents | 5713adc51f2a |
children | 3e84e001b6c1 |
comparison
equal
deleted
inserted
replaced
52642:73ab542565e0 | 52643:5cc8deb96b48 |
---|---|
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) |
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 |