You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ All contributions are greatly appreciated! Before contributing, please read the
6
6
7
7
This project uses [Poetry][] to manage dependencies and builds, and you will need to install it before working on Decoy.
8
8
9
-
Once Poetry is installed, you should be good to set up a virtual environment and install development dependencies. Python 3.11 is recommended for development.
9
+
Once Poetry is installed, you should be good to set up a virtual environment and install development dependencies. Python >=3.10 is recommended for development.
The test failed, which is good! But, the developer's next steps to fix the error aren't immediately obvious.
121
121
122
-
Your first reaction, especially if you're coming from a mocking library like [unittest.mock][], might be "We need to add an assertion that `data_getter.get` was called correctly." This would be bad, though! See [RedundantVerifyWarning](#RedundantVerifyWarning) below for why adding an assertion like this would be redundant and potentially harmful.
122
+
Your first reaction, especially if you're coming from a mocking library like [unittest.mock][], might be "We need to add an assertion that `data_getter.get` was called correctly." This would be bad, though! See [RedundantVerifyWarning](#redundantverifywarning) below for why adding an assertion like this would be redundant and potentially harmful.
123
123
124
124
Even if we shouldn't add an assertion, we still want something to help us find the underlying issue. This is where `MiscalledStubWarning` comes in. When this test is run, Decoy will print the following warnings:
Copy file name to clipboardExpand all lines: tests/typing/test_typing.yml
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,6 @@
74
74
main:10: error: Argument 1 to "then_return" of "Stub" has incompatible type "str"; expected "int" [arg-type]
75
75
76
76
- case: context_manager_stub_mimics_enter_type
77
-
skip: sys.version_info < (3, 7)
78
77
main: |
79
78
import contextlib
80
79
from typing import Generator
@@ -94,7 +93,7 @@
94
93
main:13: error: Argument 1 to "then_enter_with" of "Stub" has incompatible type "str"; expected "int" [arg-type]
95
94
96
95
- case: context_manager_stub_rejects_wrong_spec
97
-
skip: sys.version_info < (3, 7)
96
+
regex: yes
98
97
main: |
99
98
from decoy import Decoy
100
99
@@ -109,10 +108,10 @@
109
108
decoy.when(fake_any("hello")).then_enter_with(42)
110
109
111
110
out: |
112
-
main:10: error: Invalid self argument "Stub[int]" to attribute function "then_enter_with" with type "Callable[[Stub[AbstractContextManager[ContextValueT]], ContextValueT], None]" [misc]
113
-
main:10: error: No overload variant of "then_enter_with" of "Stub" matches argument type "int" [call-overload]
111
+
main:10: error: Invalid self argument "Stub\[int]" to attribute function "then_enter_with" with type "Callable\[\[Stub\[.*ContextManager\[ContextValueT]], ContextValueT], None]" \[misc]
112
+
main:10: error: No overload variant of "then_enter_with" of "Stub" matches argument type "int" \[call-overload]
0 commit comments