boolean (@NotNull final AbstractPythonLegacyTestRunConfiguration cfg, @NotNull final PyElement element) { final PyFile containingFile = PyUtil.getContainingPyFile(element); if (containingFile == null) return false; final VirtualFile vFile = containingFile.getVirtualFile(); if (vFile == null) return false; final VirtualFile parent = vFile.getParent(); if (parent == null) return false; cfg.setScriptName(vFile.getPath()); if (StringUtil.isEmptyOrSpaces(cfg.getWorkingDirectory())) { cfg.setWorkingDirectory(parent.getPath()); } cfg.setGeneratedName(); setModuleSdk(element, cfg); return true; }