![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
.. image:: https://img.shields.io/pypi/v/celery-mock.svg :target: https://pypi.python.org/pypi/celery-mock
.. image:: https://img.shields.io/travis/ulamlabs/celery-mock.svg :target: https://travis-ci.org/ulamlabs/celery-mock
.. image:: https://codecov.io/gh/ulamlabs/celery-mock/branch/master/graph/badge.svg :target: https://codecov.io/gh/ulamlabs/celery-mock
celery-mock allows you to mock celery task and then run them when you want
Sometimes a celery task retries itself to wait for some event or model to change. This is hard to test because celery tasks run (and retry) inline in tests. Now you can choose when to run your tasks.
.. code-block:: bash
pip install celery-mock
.. code-block:: python
from celery_mock import task_mock
from django.test import TestCase, Client
from myapp import dummyview
class UsersTestCase(TestCase):
def test_create_user(self):
client = Client()
client.post('/api/users/', data={'username': 'konrad') # runs tasks inline
with task_mock():
client.post('/api/users/', data={'username': 'konrad')
# no tasks started yet
# all tasks ran here
with task_mock('myapp.post_user_create_task'):
client.post('/api/users/', data={'username': 'konrad')
# all tasks started execept myapp.post_user_create_task
# myapp.post_user_create_task started here
# you can use task_mock manually:
tmock = task_mock().start()
client.post('/api/users/', data={'username': 'konrad')
# no tasks started yet
tomock.stop() # all tasks ran here
FAQs
celery-mock allows you to mock celery task and run them when you want
We found that celery-mock demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.