(self, exc_type, exc_val, exc_tb)
| 341 | return self |
| 342 | |
| 343 | def __exit__(self, exc_type, exc_val, exc_tb): |
| 344 | saved_values = self.saved_values |
| 345 | self.saved_values = None |
| 346 | |
| 347 | # Some resources use weak references |
| 348 | support.gc_collect() |
| 349 | |
| 350 | for name, get, restore, original in saved_values: |
| 351 | current = get() |
| 352 | # Check for changes to the resource's value |
| 353 | if current != original: |
| 354 | support.environment_altered = True |
| 355 | restore(original) |
| 356 | if not self.quiet and not self.pgo: |
| 357 | print_warning( |
| 358 | f"{name} was modified by {self.test_name}\n" |
| 359 | f" Before: {original}\n" |
| 360 | f" After: {current} ") |
| 361 | return False |
nothing calls this directly
no test coverage detected