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 duplicate prefixes issues #524

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/unit/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ def test_app_register_builtins(app):
assert "builtin:procrastinate.builtin_tasks.remove_old_jobs" in app.tasks


def test_builtin_tasks_prefix(app, connector):
# Test that when assigning multiple apps, we don't end up with duplicate
# namespaces.
app2 = app_module.App(connector=connector)
assert "builtin:procrastinate.builtin_tasks.remove_old_jobs" in app.tasks
assert (
"builtin:builtin:procrastinate.builtin_tasks.remove_old_jobs" not in app.tasks
)
assert app2.tasks == app.tasks


def test_app_register(app):
task = tasks.Task(task_func, blueprint=app, queue="queue", name="bla")

Expand Down
Loading