Skip to content

Commit

Permalink
Revert commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
abondar committed Oct 14, 2024
1 parent c0f4fe8 commit a3dfcd6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/test_concurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from tests.testmodels import Tournament, UniqueName
from tortoise.contrib import test
# from tortoise.contrib.test.condition import NotIn
from tortoise.contrib.test.condition import NotEQ
from tortoise.transactions import in_transaction


Expand All @@ -30,14 +30,14 @@ async def test_nonconcurrent_get_or_create(self):
for una in unas:
self.assertEqual(una[0], unas[0][0])

# @test.skipIf(sys.version_info < (3, 7), "aiocontextvars backport not handling this well")
# @test.requireCapability(dialect=NotIn("mssql", "oracle"))
# async def test_concurrent_get_or_create(self):
# unas = await asyncio.gather(*[UniqueName.get_or_create(name="d") for _ in range(10)])
# una_created = [una[1] for una in unas if una[1] is True]
# self.assertEqual(len(una_created), 1)
# for una in unas:
# self.assertEqual(una[0], unas[0][0])
@test.skipIf(sys.version_info < (3, 7), "aiocontextvars backport not handling this well")
@test.requireCapability(dialect=NotEQ("mssql"))
async def test_concurrent_get_or_create(self):
unas = await asyncio.gather(*[UniqueName.get_or_create(name="d") for _ in range(10)])
una_created = [una[1] for una in unas if una[1] is True]
self.assertEqual(len(una_created), 1)
for una in unas:
self.assertEqual(una[0], unas[0][0])

@test.skipIf(sys.version_info < (3, 7), "aiocontextvars backport not handling this well")
@test.requireCapability(supports_transactions=True)
Expand Down

0 comments on commit a3dfcd6

Please sign in to comment.