Skip in py3.8

This commit is contained in:
Nuno Campos 2023-09-29 11:49:12 +01:00
parent b8e3e1118d
commit 7bfee012d5
2 changed files with 5 additions and 4 deletions

View File

@ -120,7 +120,6 @@ def get_lambda_source(func: Callable) -> Optional[str]:
""" """
try: try:
code = inspect.getsource(func) code = inspect.getsource(func)
print(code)
tree = ast.parse(textwrap.dedent(code)) tree = ast.parse(textwrap.dedent(code))
visitor = GetLambdaSource() visitor = GetLambdaSource()
visitor.visit(tree) visitor.visit(tree)

View File

@ -1277,7 +1277,8 @@ def test_combining_sequences(
assert chain.first == prompt assert chain.first == prompt
assert chain.middle == [chat] assert chain.middle == [chat]
assert chain.last == parser assert chain.last == parser
assert dumps(chain, pretty=True) == snapshot if sys.version_info >= (3, 9):
assert dumps(chain, pretty=True) == snapshot
prompt2 = ( prompt2 = (
SystemMessagePromptTemplate.from_template("You are a nicer assistant.") SystemMessagePromptTemplate.from_template("You are a nicer assistant.")
@ -2101,7 +2102,8 @@ async def test_llm_with_fallbacks(
assert await runnable.ainvoke("hello") == "bar" assert await runnable.ainvoke("hello") == "bar"
assert await runnable.abatch(["hi", "hey", "bye"]) == ["bar"] * 3 assert await runnable.abatch(["hi", "hey", "bye"]) == ["bar"] * 3
assert list(await runnable.ainvoke("hello")) == list("bar") assert list(await runnable.ainvoke("hello")) == list("bar")
assert dumps(runnable, pretty=True) == snapshot if sys.version_info >= (3, 9):
assert dumps(runnable, pretty=True) == snapshot
class FakeSplitIntoListParser(BaseOutputParser[List[str]]): class FakeSplitIntoListParser(BaseOutputParser[List[str]]):
@ -2744,7 +2746,7 @@ async def test_runnable_branch_abatch() -> None:
@pytest.mark.skipif( @pytest.mark.skipif(
sys.version_info < (3, 9), reason="Requires python version >= 3.9 to run." sys.version_info < (3, 9), reason="Requires python version >= 3.9 to run."
) )
def test_reprsentation_of_runnables() -> None: def test_representation_of_runnables() -> None:
"""Test representation of runnables.""" """Test representation of runnables."""
runnable = RunnableLambda(lambda x: x * 2) runnable = RunnableLambda(lambda x: x * 2)
assert repr(runnable) == "RunnableLambda(lambda x: x * 2)" assert repr(runnable) == "RunnableLambda(lambda x: x * 2)"