Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork937
Commitcf2576e
committed
Make/use test.deprecation.lib; abandon idea to filter by module
This creates a module test.deprecation.lib in the test suite fora couple general helpers used in deprecation tests, one of which isnow used in two of the test modules and the other of which happensonly to be used in one but is concepually related to the first.The assert_no_deprecation_warning context manager function fixestwo different flawed approaches to that, which were in use earlier:- In test_basic, only DeprecationWarning and not the less significant PendingDeprecationWarning had been covere, which it should, at least for symmetry, since pytest.deprecated_call() treats it like DeprecationWarning. There was also a comment expressing a plan to make it filter only for warnings originating from GitPython, which was a flawed idea, as detailed below.- In test_cmd_git, the flawed idea of attempting to filter only for warnings originating from GitPython was implemented. The problem with this is that it is heavily affected by stacklevel and its interaction with the pattern of calls through which the warning arises: warnings could actually emanate from code in GitPython's git module, but be registered as having come from test code, a callback in gitdb, smmap, or the standard library, or even the pytest test runner. Some of these are more likely than others, but all are possible especially considering the possibility of a bug in the value passed to warning.warn as stacklevel. (It may be valuable for such bugs to cause tests to fail, but they should not cause otherwise failing tests to wrongly pass.) It is probably feasible to implement such filtering successfully, but I don't think it's worthwhile for the small reduction in likelihood of failing later on an unrealted DeprecationWarning from somewhere else, especially considering that GitPython's main dependencies are so minimal.1 parent7cd3aa9 commitcf2576e
3 files changed
+40
-37
lines changedLines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + |
Lines changed: 8 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
19 |
| - | |
20 |
| - | |
21 | 18 |
| |
22 | 19 |
| |
23 | 20 |
| |
24 | 21 |
| |
25 | 22 |
| |
26 | 23 |
| |
27 | 24 |
| |
| 25 | + | |
| 26 | + | |
28 | 27 |
| |
29 | 28 |
| |
30 | 29 |
| |
| |||
38 | 37 |
| |
39 | 38 |
| |
40 | 39 |
| |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 |
| - | |
45 |
| - | |
46 |
| - | |
47 |
| - | |
48 |
| - | |
49 |
| - | |
50 | 40 |
| |
51 | 41 |
| |
52 | 42 |
| |
| |||
72 | 62 |
| |
73 | 63 |
| |
74 | 64 |
| |
75 |
| - | |
| 65 | + | |
76 | 66 |
| |
77 | 67 |
| |
78 | 68 |
| |
| |||
84 | 74 |
| |
85 | 75 |
| |
86 | 76 |
| |
87 |
| - | |
| 77 | + | |
88 | 78 |
| |
89 | 79 |
| |
90 | 80 |
| |
91 | 81 |
| |
92 | 82 |
| |
93 |
| - | |
| 83 | + | |
94 | 84 |
| |
95 | 85 |
| |
96 | 86 |
| |
| |||
102 | 92 |
| |
103 | 93 |
| |
104 | 94 |
| |
105 |
| - | |
| 95 | + | |
106 | 96 |
| |
107 | 97 |
| |
108 | 98 |
| |
| |||
114 | 104 |
| |
115 | 105 |
| |
116 | 106 |
| |
117 |
| - | |
| 107 | + | |
118 | 108 |
| |
119 | 109 |
| |
120 | 110 |
| |
| |||
128 | 118 |
| |
129 | 119 |
| |
130 | 120 |
| |
131 |
| - | |
| 121 | + | |
132 | 122 |
| |
133 | 123 |
| |
134 | 124 |
|
Lines changed: 5 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
59 |
| - | |
60 | 59 |
| |
61 | 60 |
| |
62 | 61 |
| |
63 | 62 |
| |
64 |
| - | |
65 | 63 |
| |
66 | 64 |
| |
67 | 65 |
| |
| |||
73 | 71 |
| |
74 | 72 |
| |
75 | 73 |
| |
| 74 | + | |
| 75 | + | |
76 | 76 |
| |
77 | 77 |
| |
78 | 78 |
| |
| |||
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 |
| - | |
91 |
| - | |
92 | 85 |
| |
93 | 86 |
| |
94 | 87 |
| |
| |||
129 | 122 |
| |
130 | 123 |
| |
131 | 124 |
| |
132 |
| - | |
| 125 | + | |
133 | 126 |
| |
134 | 127 |
| |
135 | 128 |
| |
136 | 129 |
| |
137 | 130 |
| |
138 | 131 |
| |
139 | 132 |
| |
140 |
| - | |
| 133 | + | |
141 | 134 |
| |
142 | 135 |
| |
143 | 136 |
| |
| |||
323 | 316 |
| |
324 | 317 |
| |
325 | 318 |
| |
326 |
| - | |
327 |
| - | |
328 |
| - | |
329 |
| - | |
330 |
| - | |
331 |
| - | |
332 |
| - | |
333 |
| - | |
| 319 | + | |
334 | 320 |
| |
335 | 321 |
| |
336 | 322 |
| |
|
0 commit comments
Comments
(0)