Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crashes in tests due to a reused registry #476

Merged
merged 6 commits into from
Jan 24, 2025

Conversation

devkral
Copy link
Contributor

@devkral devkral commented Jan 24, 2025

Checklist

  • The code has 100% test coverage.
  • The documentation was properly created or updated (if applicable) following the correct guidelines and appropriate language.
  • I branched out from the latest main or is a sub-branch.

Summary or description

With edgy 0.25.0 a check was introduced so models don't get automatically replaced when a new model with the same name and
the same registry was specified.
Esmerald uses for tests a central settings object with a cached registry on it. Multiple test files define same named models on the same registry. Guess what? Silent replacements, a source of pain and workarounds and now it finally just crashed on the try.

This PR cleans the silent replacements up. It creates a local Registry for all edgy model defining tests except for cli which uses the edgy_registry now exclusively.

- ensure the registry is clean, there are no objects of an other test in
  case of own model registrations
- fix examples
- replace edgy_registry with edgy_database and provide always a fresh
  database
@tarsil tarsil merged commit 96e9039 into main Jan 24, 2025
11 checks passed
@tarsil tarsil deleted the devkral/fixes/registry_clashes branch January 24, 2025 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants