Repository navigation
Conversation
`start()` runs `pg_ctl start` synchronously on Windows, so `self.process` is never set: `_windows_terminate_process()` returned early, `_process` was never read, and the `AttributeError` fallback could not run because `os.killpg` exists on every non-Windows platform. Drop the helper, the assignments, the fallback and the tests that cover them. On Windows `stop()` is now just `pg_ctl stop`. Closes dbfixtures#1504
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The moved 'except ProcessFinishedWithError' branch is now reached by a test that makes super().stop() raise it.
| ) | ||
| mock_terminate.assert_called_once_with(None) | ||
| mock_super_stop.assert_not_called() | ||
| assert not hasattr(executor, "_process") |
There was a problem hiding this comment.
let's not assert for code we dropped, likely it won't be back
Closes #1504.
On Windows,
start()runspg_ctl startsynchronously and returns without callingsuper().start(), soself.processis never set. That made the rest of the Windows stop path dead code:_windows_terminate_process()always returned atif self.process is None.self._process = Noneset an attribute nothing reads; mirakuru keeps the process inself.processand clears it through_clear_process().except AttributeErrorfallback could not run: the branch above it handles Windows, andos.killpgexists on every non-Windows platform.stop()now runspg_ctl stopand, off Windows, delegates tosuper().stop()as before. The helper, both_processassignments, the fallback and the tests that covered them are gone.Testing
tests/test_windows_compatibility.py-> 38 passed.test_stop_method_windowsnow asserts that onlypg_ctl stopruns, thatsuper().stop()is not called, and that no_processattribute is created.pg_ctl/pg_configin this environment. The same 14 failures and 76 errors occur on the base commit; the only difference is the three tests removed here.ruff checkandruff format --checkpass.Summary by CodeRabbit