fix(resources): add expires_at sentinel comment; move pytest import to module level

This commit is contained in:
pyr0ball 2026-03-30 20:25:58 -07:00
parent 0888f0f16b
commit b774afb6b0
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ class VRAMLease:
mb_granted: int
holder_service: str
priority: int
expires_at: float
expires_at: float # unix timestamp; 0.0 = no expiry
@classmethod
def create(

View file

@ -1,4 +1,5 @@
import time
import pytest
from circuitforge_core.resources.models import VRAMLease, GpuInfo, NodeInfo
@ -27,7 +28,6 @@ def test_vram_lease_create_no_ttl_has_zero_expiry():
def test_vram_lease_is_immutable():
lease = VRAMLease.create(gpu_id=0, node_id="heimdall", mb=1024,
service="snipe", priority=2)
import pytest
with pytest.raises((AttributeError, TypeError)):
lease.mb_granted = 999 # type: ignore