boolean (@NotNull final PyToxConfiguration configuration, @NotNull final ConfigurationContext context) { final Location<?> location = context.getLocation(); if (location == null) { return false; } final VirtualFile virtualFile = location.getVirtualFile(); if (virtualFile == null) { return false; } final String currentPath = virtualFile.getParent().getCanonicalPath(); final String directoryPath = configuration.getWorkingDirectory(); if (currentPath != null && directoryPath != null && ! directoryPath.equals(currentPath)) { return false; // Tox but for different dir } return TOX_FILE_NAME.equals(virtualFile.getName()); }