Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion githubkit/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from datetime import datetime, timedelta, timezone
import time
from types import TracebackType
from typing import TYPE_CHECKING, Any, Generic, TypeVar, cast, overload
from typing import TYPE_CHECKING, Any, Generic, TypeVar, overload

import anyio
import httpx
Expand Down
10 changes: 5 additions & 5 deletions tests/test_unit_test/test_unit_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import timedelta
import json
from pathlib import Path
import threading
from datetime import timedelta
from typing import Any, TypeVar

from githubkit_schemas.latest.models import FullRepository
Expand Down Expand Up @@ -110,6 +110,7 @@ def test_mem_cache_passive_expiry():
cache.set("key2", "val2", timedelta(hours=1))

import time

time.sleep(0.01)

assert cache.get("key1") is None
Expand All @@ -119,10 +120,9 @@ def test_mem_cache_passive_expiry():

def test_core_context_manager_safety():
gh = GitHubCore()
with pytest.raises(RuntimeError):
with gh:
with gh:
pass
with gh:
with pytest.raises(RuntimeError):
gh.__enter__()

# Ensure no lingering client after error
assert gh._GitHubCore__sync_client.get() is None