Skip to content

Commit

Permalink
Rename GuiTestAssistant to TestAssistant (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdickinson authored Jul 9, 2021
1 parent 7eae70f commit 9ea07dc
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 53 deletions.
4 changes: 2 additions & 2 deletions traits_futures/asyncio/tests/test_pingee.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
import unittest

from traits_futures.asyncio.event_loop import AsyncioEventLoop
from traits_futures.testing.gui_test_assistant import GuiTestAssistant
from traits_futures.testing.test_assistant import TestAssistant
from traits_futures.tests.i_pingee_tests import IPingeeTests


class TestPingee(GuiTestAssistant, IPingeeTests, unittest.TestCase):
class TestPingee(TestAssistant, IPingeeTests, unittest.TestCase):

event_loop_factory = AsyncioEventLoop
4 changes: 2 additions & 2 deletions traits_futures/qt/tests/test_pingee.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

import unittest

from traits_futures.testing.gui_test_assistant import GuiTestAssistant
from traits_futures.testing.optional_dependencies import requires_qt
from traits_futures.testing.test_assistant import TestAssistant
from traits_futures.tests.i_pingee_tests import IPingeeTests


@requires_qt
class TestPingee(GuiTestAssistant, IPingeeTests, unittest.TestCase):
class TestPingee(TestAssistant, IPingeeTests, unittest.TestCase):
def event_loop_factory(self):
from traits_futures.qt.event_loop import QtEventLoop

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class _HasBool(HasStrictTraits):
flag = Bool(False)


class GuiTestAssistant:
class TestAssistant:
"""
Convenience mixin class for tests that need the event loop.
Expand Down
4 changes: 2 additions & 2 deletions traits_futures/tests/i_event_loop_helper_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class IEventLoopHelperTests:
Mixin for testing IEventLoopHelper implementations.
Unlike other similar event-loop-specific test helpers, this mixin
should *not* be used alongside the GuiTestAssistant: it's testing
the foundations that the GuiTestAssistant is built on.
should *not* be used alongside the TestAssistant: it's testing
the foundations that the TestAssistant is built on.
"""

#: Factory for the event loop. This should be a zero-argument callable
Expand Down
2 changes: 1 addition & 1 deletion traits_futures/tests/i_message_router_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class IMessageRouterTests:
"""
Test mix-in for testing implementations of the IMessageRouter interface.
Should be used in conjunction with the GuiTestAssistant.
Should be used in conjunction with the TestAssistant.
"""

#: Factory providing the parallelism context.
Expand Down
2 changes: 1 addition & 1 deletion traits_futures/tests/i_pingee_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class IPingeeTests:
"""
Mixin class for testing IPingee and IPinger implementations.
Should be used in combination with the GuiTestAssistant.
Should be used in combination with the TestAssistant.
"""

def test_single_background_ping(self):
Expand Down
8 changes: 4 additions & 4 deletions traits_futures/tests/test_background_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
import unittest

from traits_futures.api import MultithreadingContext, TraitsExecutor
from traits_futures.testing.gui_test_assistant import GuiTestAssistant
from traits_futures.testing.test_assistant import TestAssistant
from traits_futures.tests.background_call_tests import BackgroundCallTests

#: Timeout for blocking operations, in seconds.
TIMEOUT = 10.0


class TestBackgroundCall(
GuiTestAssistant, BackgroundCallTests, unittest.TestCase
TestAssistant, BackgroundCallTests, unittest.TestCase
):
def setUp(self):
GuiTestAssistant.setUp(self)
TestAssistant.setUp(self)
self._context = MultithreadingContext()
self.executor = TraitsExecutor(
context=self._context,
Expand All @@ -34,7 +34,7 @@ def setUp(self):
def tearDown(self):
self.halt_executor()
self._context.close()
GuiTestAssistant.tearDown(self)
TestAssistant.tearDown(self)

@contextlib.contextmanager
def block_worker_pool(self):
Expand Down
8 changes: 4 additions & 4 deletions traits_futures/tests/test_background_iteration.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import unittest

from traits_futures.api import MultithreadingContext, TraitsExecutor
from traits_futures.testing.gui_test_assistant import GuiTestAssistant
from traits_futures.testing.test_assistant import TestAssistant
from traits_futures.tests.background_iteration_tests import (
BackgroundIterationTests,
)
Expand All @@ -26,10 +26,10 @@


class TestBackgroundIteration(
GuiTestAssistant, BackgroundIterationTests, unittest.TestCase
TestAssistant, BackgroundIterationTests, unittest.TestCase
):
def setUp(self):
GuiTestAssistant.setUp(self)
TestAssistant.setUp(self)
self._context = MultithreadingContext()
self.executor = TraitsExecutor(
context=self._context,
Expand All @@ -39,7 +39,7 @@ def setUp(self):
def tearDown(self):
self.halt_executor()
self._context.close()
GuiTestAssistant.tearDown(self)
TestAssistant.tearDown(self)

@contextlib.contextmanager
def block_worker_pool(self):
Expand Down
8 changes: 4 additions & 4 deletions traits_futures/tests/test_background_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import unittest

from traits_futures.api import MultithreadingContext, TraitsExecutor
from traits_futures.testing.gui_test_assistant import GuiTestAssistant
from traits_futures.testing.test_assistant import TestAssistant
from traits_futures.tests.background_progress_tests import (
BackgroundProgressTests,
)
Expand All @@ -26,10 +26,10 @@


class TestBackgroundProgress(
GuiTestAssistant, BackgroundProgressTests, unittest.TestCase
TestAssistant, BackgroundProgressTests, unittest.TestCase
):
def setUp(self):
GuiTestAssistant.setUp(self)
TestAssistant.setUp(self)
self._context = MultithreadingContext()
self.executor = TraitsExecutor(
context=self._context,
Expand All @@ -39,7 +39,7 @@ def setUp(self):
def tearDown(self):
self.halt_executor()
self._context.close()
GuiTestAssistant.tearDown(self)
TestAssistant.tearDown(self)

@contextlib.contextmanager
def block_worker_pool(self):
Expand Down
8 changes: 4 additions & 4 deletions traits_futures/tests/test_multiprocessing_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
import unittest

from traits_futures.multiprocessing_context import MultiprocessingContext
from traits_futures.testing.gui_test_assistant import GuiTestAssistant
from traits_futures.testing.test_assistant import TestAssistant
from traits_futures.tests.i_message_router_tests import IMessageRouterTests


class TestMultiprocessingRouter(
GuiTestAssistant, IMessageRouterTests, unittest.TestCase
TestAssistant, IMessageRouterTests, unittest.TestCase
):
"""
Test that MultiprocessingRouter implements the IMessageRouter interface.
Expand All @@ -31,9 +31,9 @@ def context_factory(self):
return MultiprocessingContext()

def setUp(self):
GuiTestAssistant.setUp(self)
TestAssistant.setUp(self)
IMessageRouterTests.setUp(self)

def tearDown(self):
IMessageRouterTests.tearDown(self)
GuiTestAssistant.tearDown(self)
TestAssistant.tearDown(self)
8 changes: 4 additions & 4 deletions traits_futures/tests/test_multithreading_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
import unittest

from traits_futures.multithreading_context import MultithreadingContext
from traits_futures.testing.gui_test_assistant import GuiTestAssistant
from traits_futures.testing.test_assistant import TestAssistant
from traits_futures.tests.i_message_router_tests import IMessageRouterTests


class TestMultithreadingRouter(
GuiTestAssistant, IMessageRouterTests, unittest.TestCase
TestAssistant, IMessageRouterTests, unittest.TestCase
):
"""
Test that MultithreadingRouter implements the IMessageRouter interface.
Expand All @@ -31,9 +31,9 @@ def context_factory(self):
return MultithreadingContext()

def setUp(self):
GuiTestAssistant.setUp(self)
TestAssistant.setUp(self)
IMessageRouterTests.setUp(self)

def tearDown(self):
IMessageRouterTests.tearDown(self)
GuiTestAssistant.tearDown(self)
TestAssistant.tearDown(self)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Thanks for using Enthought open source!

"""
Tests for the GuiTestAssistant.
Tests for the TestAssistant.
"""
import time
import unittest.mock
Expand All @@ -22,7 +22,7 @@
submit_call,
TraitsExecutor,
)
from traits_futures.testing.gui_test_assistant import GuiTestAssistant
from traits_futures.testing.test_assistant import TestAssistant

#: Maximum timeout for blocking calls, in seconds. A successful test should
#: never hit this timeout - it's there to prevent a failing test from hanging
Expand All @@ -42,12 +42,12 @@ def slow_return():
return 1729


class TestGuiTestAssistant(GuiTestAssistant, unittest.TestCase):
class TestTestAssistant(TestAssistant, unittest.TestCase):
def setUp(self):
GuiTestAssistant.setUp(self)
TestAssistant.setUp(self)

def tearDown(self):
GuiTestAssistant.tearDown(self)
TestAssistant.tearDown(self)

def test_run_until_timeout(self):
# Trait never fired, condition never true.
Expand Down
20 changes: 10 additions & 10 deletions traits_futures/tests/test_traits_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
MultithreadingContext,
TraitsExecutor,
)
from traits_futures.testing.gui_test_assistant import GuiTestAssistant
from traits_futures.testing.test_assistant import TestAssistant
from traits_futures.tests.traits_executor_tests import (
ExecutorListener,
TraitsExecutorTests,
Expand Down Expand Up @@ -54,14 +54,14 @@ def __context_default(self):
return TraitsExecutor._TraitsExecutor__context_default(self)


class TestTraitsExecutorCreation(GuiTestAssistant, unittest.TestCase):
class TestTraitsExecutorCreation(TestAssistant, unittest.TestCase):
def setUp(self):
GuiTestAssistant.setUp(self)
TestAssistant.setUp(self)
self._context = MultithreadingContext()

def tearDown(self):
self._context.close()
GuiTestAssistant.tearDown(self)
TestAssistant.tearDown(self)

def test_max_workers(self):
executor = TraitsExecutor(
Expand Down Expand Up @@ -228,10 +228,10 @@ def temporary_executor(self, **kwds):


class TestTraitsExecutor(
GuiTestAssistant, TraitsExecutorTests, unittest.TestCase
TestAssistant, TraitsExecutorTests, unittest.TestCase
):
def setUp(self):
GuiTestAssistant.setUp(self)
TestAssistant.setUp(self)
self._context = MultithreadingContext()
self.executor = TraitsExecutor(
context=self._context,
Expand All @@ -245,14 +245,14 @@ def tearDown(self):
del self.executor
self._context.close()
del self._context
GuiTestAssistant.tearDown(self)
TestAssistant.tearDown(self)


class TestTraitsExecutorWithExternalWorkerPool(
GuiTestAssistant, TraitsExecutorTests, unittest.TestCase
TestAssistant, TraitsExecutorTests, unittest.TestCase
):
def setUp(self):
GuiTestAssistant.setUp(self)
TestAssistant.setUp(self)
self._context = MultithreadingContext()
self._worker_pool = self._context.worker_pool()
self.executor = TraitsExecutor(
Expand All @@ -270,4 +270,4 @@ def tearDown(self):
del self._worker_pool
self._context.close()
del self._context
GuiTestAssistant.tearDown(self)
TestAssistant.tearDown(self)
14 changes: 7 additions & 7 deletions traits_futures/tests/test_traits_process_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
MultithreadingContext,
TraitsExecutor,
)
from traits_futures.testing.gui_test_assistant import GuiTestAssistant
from traits_futures.testing.test_assistant import TestAssistant
from traits_futures.tests.traits_executor_tests import (
ExecutorListener,
TraitsExecutorTests,
Expand All @@ -32,14 +32,14 @@
SAFETY_TIMEOUT = 5.0


class TestTraitsExecutorCreation(GuiTestAssistant, unittest.TestCase):
class TestTraitsExecutorCreation(TestAssistant, unittest.TestCase):
def setUp(self):
GuiTestAssistant.setUp(self)
TestAssistant.setUp(self)
self._context = MultiprocessingContext()

def tearDown(self):
self._context.close()
GuiTestAssistant.tearDown(self)
TestAssistant.tearDown(self)

def test_max_workers(self):
executor = TraitsExecutor(
Expand Down Expand Up @@ -155,10 +155,10 @@ def temporary_executor(self, **kwds):


class TestTraitsExecutor(
GuiTestAssistant, TraitsExecutorTests, unittest.TestCase
TestAssistant, TraitsExecutorTests, unittest.TestCase
):
def setUp(self):
GuiTestAssistant.setUp(self)
TestAssistant.setUp(self)
self._context = MultiprocessingContext()
self.executor = TraitsExecutor(
context=self._context,
Expand All @@ -172,4 +172,4 @@ def tearDown(self):
del self.executor
self._context.close()
del self._context
GuiTestAssistant.tearDown(self)
TestAssistant.tearDown(self)
4 changes: 2 additions & 2 deletions traits_futures/wx/tests/test_pingee.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

import unittest

from traits_futures.testing.gui_test_assistant import GuiTestAssistant
from traits_futures.testing.optional_dependencies import requires_wx
from traits_futures.testing.test_assistant import TestAssistant
from traits_futures.tests.i_pingee_tests import IPingeeTests


@requires_wx
class TestPingee(GuiTestAssistant, IPingeeTests, unittest.TestCase):
class TestPingee(TestAssistant, IPingeeTests, unittest.TestCase):
def event_loop_factory(self):
from traits_futures.wx.event_loop import WxEventLoop

Expand Down

0 comments on commit 9ea07dc

Please sign in to comment.