From 611fce2b2f22ae1951f3fdd4a5b846d7d4d8b221 Mon Sep 17 00:00:00 2001 From: Tasha Upchurch Date: Fri, 7 Jul 2023 02:53:53 -0400 Subject: [PATCH] aider: Fixed relative import error in test_git.py. # Context: USER: I ran this command: python E:/git/ComfyUI/custom_nodes/EternalKernelLiteGraphNodes/tests/test_git.py And got this output: Traceback (most recent call last): File "E:\git\ComfyUI\custom_nodes\EternalKernelLiteGraphNodes\tests\test_git.py", line 3, in from custom_nodes.EternalKernelLiteGraphNodes.git import CreateRepoNode ModuleNotFoundError: No module named 'custom_nodes.EternalKernelLiteGraphNodes' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\git\ComfyUI\custom_nodes\EternalKernelLiteGraphNodes\tests\test_git.py", line 5, in from ..git import CreateRepoNode ImportError: attempted relative import with no known parent package --- tests/test_git.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/test_git.py b/tests/test_git.py index 7de04f2..510821e 100644 --- a/tests/test_git.py +++ b/tests/test_git.py @@ -1,10 +1,5 @@ import unittest -try: - from custom_nodes.EternalKernelLiteGraphNodes.git import CreateRepoNode -except: - from ..git import CreateRepoNode - - +from custom_nodes.EternalKernelLiteGraphNodes.git import CreateRepoNode class TestCreateRepoNode(unittest.TestCase): def test_create_repo(self): @@ -12,6 +7,5 @@ class TestCreateRepoNode(unittest.TestCase): node.create_repo(subdirectory="my_repo") # Add assertions or additional test logic here - if __name__ == "__main__": unittest.main()