mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-06 19:42:34 +08:00
fix: remaining ruff linting errors in services tests
- Remove unused os imports in conftest.py and test_ingest.py - Remove unused Tag import in test_asset_management.py - Remove unused ensure_tags_exist import in test_ingest.py - Fix unused info2 variable in test_asset_management.py Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4e02245012
commit
11ca1995a3
@ -1,4 +1,3 @@
|
||||
import os
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
import pytest
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.assets.database.models import Asset, AssetInfo, Tag
|
||||
from app.assets.database.models import Asset, AssetInfo
|
||||
from app.assets.database.queries import ensure_tags_exist, add_tags_to_asset_info
|
||||
from app.assets.helpers import utcnow
|
||||
from app.assets.services import (
|
||||
@ -179,7 +179,7 @@ class TestDeleteAssetReference:
|
||||
def test_keeps_asset_if_other_infos_exist(self, mock_create_session, session: Session):
|
||||
asset = _make_asset(session)
|
||||
info1 = _make_asset_info(session, asset, name="info1")
|
||||
info2 = _make_asset_info(session, asset, name="info2")
|
||||
_make_asset_info(session, asset, name="info2") # Second info keeps asset alive
|
||||
asset_id = asset.id
|
||||
session.commit()
|
||||
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
"""Tests for ingest services."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.assets.database.models import Asset, AssetCacheState, AssetInfo, Tag
|
||||
from app.assets.database.queries import ensure_tags_exist, get_asset_tags
|
||||
from app.assets.database.queries import get_asset_tags
|
||||
from app.assets.services import ingest_file_from_path, register_existing_asset
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
import pytest
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.assets.database.models import Asset, AssetInfo, Tag
|
||||
from app.assets.database.models import Asset, AssetInfo
|
||||
from app.assets.database.queries import ensure_tags_exist, add_tags_to_asset_info
|
||||
from app.assets.helpers import utcnow
|
||||
from app.assets.services import apply_tags, remove_tags, list_tags
|
||||
|
||||
Loading…
Reference in New Issue
Block a user