void () { runPythonTest(new PyConsoleTask() { @Override public void before() { PyConsoleOptions.getInstance(getProject()).setCodeCompletionOption(PyConsoleOptionsConfigurable.CodeCompletionOption.STATIC); } @Override public void testing() throws Exception { exec("def foo():\n" + " pass"); exec("x = 42"); exec("s = 'str'"); getStaticCompletion("x", "foo", "s"); } private void getStaticCompletion(String... completionVariants) { myFixture.configureFromExistingVirtualFile(getConsoleView().getVirtualFile()); myFixture.completeBasic(); List<String> completions = myFixture.getLookupElementStrings(); for (String variant : completionVariants) { assertTrue(completions.contains(variant)); } } }); }