<commit_before>"""
peewee-async tests for Python 3.5+
==================================

These tests should be run only for Python 3.5+, older versions
will just fail with `SyntaxError` while importing this module.

"""
import asyncio
from . import TestModel
from . import BaseManagerTestCase


class FakeUpdateError(Exception):
    """Fake error while updating database.
    """
    pass


class ManagerTransactionsTestCase(BaseManagerTestCase):
    only = ['postgres', 'postgres-ext', 'postgres-pool', 'postgres-pool-ext']

    def test_atomic_success(self):
        """Successful update in transaction.
        """
        async def test(objects):
            obj = await objects.create(TestModel, text='FOO')
            obj_id = obj.id
<commit_msg>Tests for async MySQL are passing<commit_after>"""
peewee-async tests for Python 3.5+
==================================

These tests should be run only for Python 3.5+, older versions
will just fail with `SyntaxError` while importing this module.

"""
import asyncio
from . import TestModel
from . import BaseManagerTestCase


class FakeUpdateError(Exception):
    """Fake error while updating database.
    """
    pass


class ManagerTransactionsTestCase(BaseManagerTestCase):
    # only = ['postgres', 'postgres-ext', 'postgres-pool', 'postgres-pool-ext']
    only = None

    def test_atomic_success(self):
        """Successful update in transaction.
        """
        async def test(objects):
            obj = await objects.create(TestModel, text='FOO')
            obj_id = obj.id

{'fraction_non_alphanumeric': 0.1410090556274256, 'fraction_numerical': 0.00517464424320828, 'mean_word_length': 3.576923076923077, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5132066', 'n_tokens_mistral': 427, 'n_tokens_neox': 405, 'n_words': 135}