procrastinate-org / procrastinate

PostgreSQL-based Task Queue for Python
https://procrastinate.readthedocs.io/
MIT License
800 stars 52 forks source link

app.replace_connector to ease tests #1102

Closed ewjoachim closed 1 week ago

ewjoachim commented 1 week ago

Closes #1099

@medihack This is PR where I add app.replace_connector that should be the answer to the issue you raised. If you can check that it answers your issue.

Successful PR Checklist:

PR label(s):

github-actions[bot] commented 1 week ago

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  procrastinate
  app.py
  signals.py
Project Total  

This report was generated by python-coverage-comment-action

medihack commented 1 week ago

Thanks a lot, this works fine! There are still some other occurrences of app.defer(...) in the documentation (that's why I thought it may be outdated). I guess those must be replaced by task.defer(...) as well. Maybe we can also add some "pseudo" import like from mypackage.procrastinate import task (as in the production testing documentation) to make it more clear where the task object comes from (and maybe even name it my_task).

ewjoachim commented 1 week ago

I've added a commit that should hopefully answer your comments :)

medihack commented 1 week ago

Cool, thanks so much. Looks more consistent now. Let's merge and publish 🙂.