Commit c7ed82a
committed
test(hygiene[run,sync/git]) Use monkeypatch.setattr; lift import time
why: ``test_run_timeout_reaps_child_process`` swapped ``subprocess.Popen``
via raw attribute assignment guarded by ``try/finally``. That pattern is
brittle under ``pytest-xdist`` parallel runs and unnecessary now that
pytest's ``monkeypatch`` fixture provides automatic restoration. Separately,
``test_remote_is_fast_for_repos_with_many_refs`` imported ``time`` inside
its body where module-scope imports are the project convention.
what:
- Take the ``monkeypatch: pytest.MonkeyPatch`` fixture and replace the
global Popen swap with ``monkeypatch.setattr``; drop the try/finally
and both ``# type: ignore`` comments.
- Move ``import time`` from inside the test body to the module-top
alphabetical import block in ``tests/sync/test_git.py``.1 parent 4c9dee5 commit c7ed82a
2 files changed
Lines changed: 9 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
109 | 107 | | |
110 | 108 | | |
111 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
1684 | 1685 | | |
1685 | 1686 | | |
1686 | 1687 | | |
1687 | | - | |
1688 | | - | |
1689 | 1688 | | |
1690 | 1689 | | |
1691 | 1690 | | |
| |||
0 commit comments