Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing GitHub Actions in test_github.py #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions libs/langchain/tests/integration_tests/utilities/test_github.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
"""Integration test for Github Wrapper."""
import pytest

from langchain.utilities.github import GitHubAPIWrapper
import logging
import logging

Check failure on line 6 in libs/langchain/tests/integration_tests/utilities/test_github.py

View workflow job for this annotation

GitHub Actions / lint / build (3.8)

Ruff (F811)

tests/integration_tests/utilities/test_github.py:6:8: F811 Redefinition of unused `logging` from line 5

Check failure on line 6 in libs/langchain/tests/integration_tests/utilities/test_github.py

View workflow job for this annotation

GitHub Actions / lint / build (3.8)

Ruff (F401)

tests/integration_tests/utilities/test_github.py:6:8: F401 `logging` imported but unused

Check failure on line 6 in libs/langchain/tests/integration_tests/utilities/test_github.py

View workflow job for this annotation

GitHub Actions / lint / build (3.11)

Ruff (F811)

tests/integration_tests/utilities/test_github.py:6:8: F811 Redefinition of unused `logging` from line 5

Check failure on line 6 in libs/langchain/tests/integration_tests/utilities/test_github.py

View workflow job for this annotation

GitHub Actions / lint / build (3.11)

Ruff (F401)

tests/integration_tests/utilities/test_github.py:6:8: F401 `logging` imported but unused

# Make sure you have set the following env variables:

Check failure on line 8 in libs/langchain/tests/integration_tests/utilities/test_github.py

View workflow job for this annotation

GitHub Actions / lint / build (3.8)

Ruff (I001)

tests/integration_tests/utilities/test_github.py:2:1: I001 Import block is un-sorted or un-formatted

Check failure on line 8 in libs/langchain/tests/integration_tests/utilities/test_github.py

View workflow job for this annotation

GitHub Actions / lint / build (3.11)

Ruff (I001)

tests/integration_tests/utilities/test_github.py:2:1: I001 Import block is un-sorted or un-formatted
# GITHUB_REPOSITORY
# GITHUB_BRANCH
# GITHUB_REPOSITORY_ENV
# GITHUB_BRANCH_ENV
# GITHUB_APP_ID
# GITHUB_PRIVATE_KEY


@pytest.fixture
def api_client() -> GitHubAPIWrapper:
def api_client(api_token: str = None, repository: str = 'owner/repo') -> GitHubAPIWrapper:

Check failure on line 16 in libs/langchain/tests/integration_tests/utilities/test_github.py

View workflow job for this annotation

GitHub Actions / lint / build (3.8)

Ruff (E501)

tests/integration_tests/utilities/test_github.py:16:89: E501 Line too long (90 > 88)

Check failure on line 16 in libs/langchain/tests/integration_tests/utilities/test_github.py

View workflow job for this annotation

GitHub Actions / lint / build (3.11)

Ruff (E501)

tests/integration_tests/utilities/test_github.py:16:89: E501 Line too long (90 > 88)
return GitHubAPIWrapper()


def test_get_open_issues(api_client: GitHubAPIWrapper) -> None:
"""Basic test to fetch issues"""
issues = api_client.get_issues()
"""Test to fetch open issues when the repository does not exist"""
issues = api_client.get_issues(filter='all', repository='nonexistent/repo')
assert len(issues) == 0
issues = api_client.get_issues(filter='all')
assert len(issues) != 0
Loading