()
| 76 | |
| 77 | @pytest.mark.mypy_testing |
| 78 | def mypy_union_typing() -> None: |
| 79 | class T(HasTraits): |
| 80 | style = Union( |
| 81 | [Unicode("default"), Type(klass=object)], |
| 82 | help="Name of the pygments style to use", |
| 83 | default_value="hi", |
| 84 | ).tag(config=True) |
| 85 | |
| 86 | t = T() |
| 87 | reveal_type(Union("foo")) # R: traitlets.traitlets.Union |
| 88 | reveal_type(Union("").tag(sync=True)) # R: traitlets.traitlets.Union |
| 89 | reveal_type(Union(None, allow_none=True)) # R: traitlets.traitlets.Union |
| 90 | reveal_type(Union(None, allow_none=True).tag(sync=True)) # R: traitlets.traitlets.Union |
| 91 | reveal_type(T.style) # R: traitlets.traitlets.Union |
| 92 | reveal_type(t.style) # R: Any |
| 93 | |
| 94 | |
| 95 | @pytest.mark.mypy_testing |
nothing calls this directly
no test coverage detected
searching dependent graphs…