Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mypy/suggestions.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ def try_type(self, func: FuncDef, typ: ProperType) -> list[str]:
def reload(self, state: State) -> list[str]:
"""Recheck the module given by state."""
assert state.path is not None
self.manager.errors.reset()
self.fgmanager.flush_cache()
return self.fgmanager.update([(state.id, state.path)], [])

Expand Down
25 changes: 25 additions & 0 deletions test-data/unit/daemon.test
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,31 @@ def bar() -> None:
x = foo('abc') # type: str
foo(arg='xyz')

[case testDaemonSuggestStdlibAfterMessage]
$ dmypy start -- --follow-imports=error --no-error-summary
Daemon started
$ dmypy check main.py
main.py:1: note: Revealed type is "Literal[1]?"
$ dmypy suggest os.path.islink --callsites
No suggestions
$ dmypy status
Daemon is up and running
$ dmypy suggest os.path.isdir --callsites
No suggestions
$ dmypy check main.py
main.py:1: note: Revealed type is "Literal[1]?"
== Return code: 1
$ {python} -c "import shutil; shutil.copy('main2.py', 'main.py')"
$ dmypy check main.py
main.py:1: note: Revealed type is "Literal[2]?"
== Return code: 1
$ dmypy stop
Daemon stopped
[file main.py]
reveal_type(1)
[file main2.py]
reveal_type(2)

[case testDaemonInspectCheck]
$ dmypy start
Daemon started
Expand Down
Loading