-
-
Notifications
You must be signed in to change notification settings - Fork 549
Expand file tree
/
Copy pathtest_helpers.yml
More file actions
18 lines (16 loc) · 792 Bytes
/
test_helpers.yml
File metadata and controls
18 lines (16 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- case: mark_safe_decorator_and_function
main: |
from django.utils.safestring import mark_safe
s = 'hello'
reveal_type(mark_safe(s)) # N: Revealed type is "django.utils.safestring.SafeString"
reveal_type(mark_safe(s) + mark_safe(s)) # N: Revealed type is "django.utils.safestring.SafeString"
reveal_type(s + mark_safe(s)) # N: Revealed type is "builtins.str"
s += mark_safe(s)
reveal_type(s) # N: Revealed type is "builtins.str"
ms = mark_safe(s)
ms += mark_safe(s)
reveal_type(ms) # N: Revealed type is "django.utils.safestring.SafeString"
@mark_safe
def func(s: str) -> str:
pass
reveal_type(func) # N: Revealed type is "def (s: builtins.str) -> builtins.str"