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