Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Sep 30, 2023
1 parent 94dc23e commit 4cadd46
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ai_diffusion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Generative AI plugin for Krita using Stable Diffusion"""

__version__ = "1.2.0"
__version__ = "1.2.1"

from . import util
from .settings import Settings, Setting, settings, PerformancePreset, ServerBackend, ServerMode
Expand Down
11 changes: 7 additions & 4 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ async def main():


def test_python_version(qtapp):
py = server.get_python_version("python")
assert py.startswith("Python 3.")
pip = server.get_python_version("pip")
assert pip.startswith("pip ")
async def main():
py = await server.get_python_version("python")
assert py.startswith("Python 3.")
pip = await server.get_python_version("pip")
assert pip.startswith("pip ")

qtapp.run(main())
4 changes: 3 additions & 1 deletion tests/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ def default_style(comfy, sd_ver=SDVersion.sd1_5):


async def receive_images(comfy: Client, workflow: ComfyWorkflow):
job_id = await comfy.enqueue(workflow)
job_id = None
async for msg in comfy.listen():
if not job_id:
job_id = await comfy.enqueue(workflow)
if msg.event is ClientEvent.finished and msg.job_id == job_id:
return msg.images
if msg.event is ClientEvent.error and msg.job_id == job_id:
Expand Down

0 comments on commit 4cadd46

Please sign in to comment.