Added deprecation tests for seq2seq generator and RAG Generator (#4782)

This commit is contained in:
Mayank Jobanputra 2023-05-02 10:00:22 +02:00 committed by GitHub
parent 896eb6a2ea
commit dcf3ddddff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,11 +5,32 @@ from unittest.mock import patch
import pytest
from haystack.schema import Document
from haystack.nodes.answer_generator import Seq2SeqGenerator, OpenAIAnswerGenerator
from haystack.nodes.answer_generator import Seq2SeqGenerator, OpenAIAnswerGenerator, RAGenerator
from haystack.pipelines import GenerativeQAPipeline
from haystack.nodes import PromptTemplate
import logging
from ..conftest import fail_at_version
@pytest.mark.unit
@fail_at_version(1, 18)
def test_seq2seq_deprecation():
with pytest.warns(DeprecationWarning):
try:
Seq2SeqGenerator("non_existing_model/model")
except OSError:
pass
@pytest.mark.unit
@fail_at_version(1, 18)
def test_rag_deprecation():
with pytest.warns(DeprecationWarning):
try:
RAGenerator("non_existing_model/model")
except OSError:
pass
@pytest.mark.integration