Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

            @wraps(func)
    def helper(*args, **kwds):
        return GeneratorContextManager(func(*args, **kwds))
        


src/d/j/django-pglocks-HEAD/django_pglocks/tests.py   django-pglocks(Download)
from django.db import connection
from django.test import TransactionTestCase
 
from django_pglocks import advisory_lock
 
    def test_basic_lock(self):
        self.assertNumLocks(0)
        with advisory_lock('test') as acquired:
            self.assertIsNone(acquired)
            self.assertNumLocks(1)