semvec/pypi-packages huggingface dataset:
celery-mock 1.1.7
celery-mock allows you to mock celery task and run them when you want
License: MIT
Requires Python: >=3.6
Keywords: celery,mock,celery_mock

===============================
Celery Task Mocking
===============================


.. 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

Rationale
==========

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.

Supported versions
==================

- Python 3 support
- Celery 3.1.x and 4.0.x support 


How to install
================

    .. code-block:: bash
    
        pip install celery-mock


How to use
==========

    .. 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
sphinxawesome-sampdirective 1.0.5
A Sphinx directive for literal blocks with emphasis
License: MIT
Requires Python: >=3.6.1,<4.0.0

# Sphinx awesome sampdirective

![GitHub](https://img.shields.io/github/license/kai687/sphinxawesome-sampdirective?color=blue&style=for-the-badge)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/kai687/sphinxawesome-sampdirective/Run%20unit%20tests?style=for-the-badge)
![PyPI](https://img.shields.io/pypi/v/sphinxawesome-sampdirective?style=for-the-badge)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sphinxawesome-sampdirective?style=for-the-badge)
![Code Style](https://img.shields.io/badge/Code%20Style-Black-000000?style=for-the-badge)

This Sphinx extension provides a new directive `samp` which works much like the
interpreted text role
[samp](https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-samp).
This extension can be used to markup placeholder variables in code blocks.

## Installation

Install the extension:

```console
pip install sphinxawesome-sampdirective
```

This Sphinx extension should work with Python versions newer than 3.6 and recent Sphinx
releases.

## Configuration

To enable this extension in Sphinx, add it to the list of extensions in the Sphinx
configuration file `conf.py`:

```python
extensions = ["sphinxawesome.sampdirective"]
```

## Use

Include the directive in your documents:

```
.. samp::

   $ echo {USERNAME}
```

`USERNAME` will become an _emphasized_ node. In many outputs, it will be rendered as
_`USERNAME`_. For example, in HTML, the above example will be rendered as:

```HTML
<pre>
    <span class="gp">$</span> echo <em class="var">USERNAME</em>
</pre>
```

You can then control the style of the emphasized element with the `.var` class in CSS.
If the code block begins with a prompt character (`#`, `$`, or `~`), they will be marked
up as well. The style for the prompt character is provided by the `pygments` syntax
highlighting module.

The [Sphinx awesome theme](https://github.com/kai687/sphinxawesome-theme) includes
styling for the `samp` directive by default.

## Caveat

This extension does not provide full syntax highlighting. It is currently not possible
to have code blocks with both markup _and_ syntax highlighting. You have to choose
between the following:

- If you need to render markup, for example links, or bold or italic text, choose the
  `parsed-literal` directive.
- If you just want to highlight a placeholder variable, use the `samp` directive
  provided by this extension.
- If you need full syntax highlighting, use the `code-block` directive.