Skip to content

Commit

Permalink
Fix more fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Jul 5, 2024
1 parent a09c240 commit 1d433a0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
31 changes: 31 additions & 0 deletions tap_github/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,37 @@
import pytest


@pytest.fixture()
def organization_list_config(request):
"""Get a default list of organizations or pass your own by decorating your test with
@pytest.mark.organization_list(['MeltanoLabs', 'oviohub'])
"""
marker = request.node.get_closest_marker("organization_list")

organization_list = ["MeltanoLabs"] if marker is None else marker.args[0]

return {
"metrics_log_level": "warning",
"start_date": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"),
"organizations": organization_list,
"rate_limit_buffer": 100,
}


@pytest.fixture()
def search_config():
return {
"metrics_log_level": "warning",
"start_date": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"),
"searches": [
{
"name": "tap_something",
"query": "tap-+language:Python",
},
],
}


@pytest.fixture()
def repo_list_config(request):
"""Get a default list of repos or pass your own by decorating your test with
Expand Down
31 changes: 0 additions & 31 deletions tap_github/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@
sys.stdout = FilterStdOutput(sys.stdout, r'{"type": ') # type: ignore


@pytest.fixture()
def search_config():
return {
"metrics_log_level": "warning",
"start_date": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"),
"searches": [
{
"name": "tap_something",
"query": "tap-+language:Python",
},
],
}


@pytest.fixture()
def user_id_list_config(request):
"""Get a default list of usernames or pass your own by decorating your test with
Expand All @@ -40,23 +26,6 @@ def user_id_list_config(request):
}


@pytest.fixture()
def organization_list_config(request):
"""Get a default list of organizations or pass your own by decorating your test with
@pytest.mark.organization_list(['MeltanoLabs', 'oviohub'])
"""
marker = request.node.get_closest_marker("organization_list")

organization_list = ["MeltanoLabs"] if marker is None else marker.args[0]

return {
"metrics_log_level": "warning",
"start_date": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"),
"organizations": organization_list,
"rate_limit_buffer": 100,
}


def alternative_sync_children(self, child_context: dict, no_sync: bool = True) -> None:
"""Override for Stream._sync_children.
Enabling us to use an ORG_LEVEL_TOKEN for the collaborators stream.
Expand Down

0 comments on commit 1d433a0

Please sign in to comment.