move and tweak tests

This commit is contained in:
doctorpangloss 2025-12-09 13:29:41 -08:00
parent a164a07073
commit 79cf2c2867
9 changed files with 9 additions and 15 deletions

View File

@ -1,21 +1,20 @@
from __future__ import annotations from __future__ import annotations
import argparse import argparse
import importlib.metadata
import importlib.resources import importlib.resources
import logging import logging
import os import os
import re import re
import tempfile import tempfile
import zipfile import zipfile
import importlib.metadata
from dataclasses import dataclass from dataclasses import dataclass
from functools import cached_property from functools import cached_property
from pathlib import Path from pathlib import Path
from typing import Dict, TypedDict, Optional from typing import Dict, TypedDict, Optional
from aiohttp import web
from importlib.metadata import version
import requests import requests
from aiohttp import web
from typing_extensions import NotRequired from typing_extensions import NotRequired
from ..cli_args import DEFAULT_VERSION_STRING from ..cli_args import DEFAULT_VERSION_STRING

View File

@ -2,6 +2,7 @@ import importlib.resources
import json import json
import logging import logging
from importlib.abc import Traversable from importlib.abc import Traversable
from typing import Any, AsyncGenerator
import pytest import pytest
@ -16,7 +17,7 @@ logger = logging.getLogger(__name__)
@pytest.fixture(scope="function", autouse=False) @pytest.fixture(scope="function", autouse=False)
async def client(tmp_path_factory) -> Comfy: async def client(tmp_path_factory) -> AsyncGenerator[Any, Any]:
async with Comfy() as client: async with Comfy() as client:
yield client yield client

0
tests/models/__init__.py Normal file
View File

View File

@ -1,11 +1,8 @@
import unittest
import torch
import sys
import os
import json import json
import unittest
import torch
# Add comfy to path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
def has_gpu(): def has_gpu():
return torch.cuda.is_available() return torch.cuda.is_available()

View File

@ -1,10 +1,7 @@
import unittest import unittest
import torch
import sys
import os
# Add comfy to path import torch
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
def has_gpu(): def has_gpu():
return torch.cuda.is_available() return torch.cuda.is_available()