Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

test(backend/store): the skills-catalog tests refuse to empty a database that holds listings (#14963)

Reinier van der Leer58a4a2b650d0
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_catalog_test.py b/autogpt_platform/backend/backend/api/features/store/skill_catalog_test.py
index 7b947197b2..e5cccb6311 100644
--- a/autogpt_platform/backend/backend/api/features/store/skill_catalog_test.py
+++ b/autogpt_platform/backend/backend/api/features/store/skill_catalog_test.py
@@ -29,9 +29,11 @@ pytestmark = pytest.mark.asyncio(loop_scope="session")
@pytest.fixture(autouse=True)
async def clean_marketplace(server: SpinTestServer):
- """These tests own the platform listings and templates they create; the
- marketplace tests in skill_db_test.py need the table empty, so leave it
- that way."""
+ # The teardown empties the marketplace tables, so take them only when empty.
+ assert not await prisma.models.SkillListing.prisma().count(), (
+ "this database already holds skill listings; run this file against a "
+ "throwaway Postgres, not the one every worktree here shares"
+ )
yield
await prisma.models.ExpertSkillListing.prisma().delete_many()
await prisma.models.Expert.prisma().delete_many(