diff --git a/packages/pyright-internal/src/tests/fourslash/importSuggestion.invokeCodeAction.fourslash.ts b/packages/pyright-internal/src/tests/fourslash/importSuggestion.invokeCodeAction.fourslash.ts new file mode 100644 index 0000000000..794aa2ea76 --- /dev/null +++ b/packages/pyright-internal/src/tests/fourslash/importSuggestion.invokeCodeAction.fourslash.ts @@ -0,0 +1,26 @@ +/// + +// @filename: pyrightconfig.json +//// {} + +// @filename: test.py +//// [|/*import*/|]foo: TracebackType[|/*marker*/|] + +const importRange = helper.getPositionRange('import'); + +//@ts-expect-error https://github.com/DetachHead/basedpyright/issues/86 +await helper.verifyCodeActions('included', { + marker: { + codeActions: [ + { + title: `from types import TracebackType`, + edit: { + changes: { + 'file:///test.py': [{ range: importRange, newText: 'from types import TracebackType\n\n\n' }], + }, + }, + kind: 'quickfix', + }, + ], + }, +});