Skip to content

Commit

Permalink
oh hey that one _is_ actually an async test case
Browse files Browse the repository at this point in the history
This commit was sponsored by Steven S., Matt Campbell, and my other
patrons.  If you want to join them, you can support my work at
https://glyph.im/patrons/.
  • Loading branch information
glyph committed Mar 18, 2024
1 parent 02df454 commit 4be1032
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/dbxs/test/test_sync_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
from twisted._threads import AlreadyQuit
from twisted._threads._ithreads import IExclusiveWorker
from twisted.internet.defer import Deferred
from twisted.trial.unittest import SynchronousTestCase as TestCase
from twisted.trial.unittest import (
SynchronousTestCase as SyncTestCase,
TestCase as AsyncTestCase,
)

from .._testing import sqlite3Connector
from .._typing_compat import ParamSpec
Expand Down Expand Up @@ -194,7 +197,7 @@ def cursor(self) -> DBAPICursor:
_2: Type[DBAPIConnection] = FakeDBAPIConnection


def realThreadedAdapter(testCase: TestCase) -> AsyncConnectable:
def realThreadedAdapter(testCase: AsyncTestCase) -> AsyncConnectable:
"""
Create an AsyncConnectable using real threads and scheduling its
non-threaded callbacks on the Twisted reactor, suitable for using in a
Expand Down Expand Up @@ -262,7 +265,7 @@ class SampleError(Exception):
"""


class ResourceManagementTests(TestCase):
class ResourceManagementTests(SyncTestCase):
"""
Tests to make sure that various thread resources are managed correctly.
"""
Expand Down Expand Up @@ -550,7 +553,7 @@ async def t1() -> None:
self.assertEqual(self.threads[1].quitted, True)


class InternalSafetyTests(TestCase):
class InternalSafetyTests(SyncTestCase):
"""
Tests for internal safety mechanisms; states which I{should} be unreachable
via the public API but should nonetheless be reported.
Expand All @@ -571,7 +574,7 @@ def test_queueQuit(self) -> None:
self.assertEqual(stuff, [])


class SyncAdapterTests(TestCase):
class SyncAdapterTests(AsyncTestCase):
"""
Integration tests for L{adaptSynchronousDriver}.
"""
Expand Down

0 comments on commit 4be1032

Please sign in to comment.