Skip to content

Commit

Permalink
Fix: ProcessRunnerTest raises in interactive mode during reloading
Browse files Browse the repository at this point in the history
* ``ProcessRunnerTest`` and other tests based on it (such as ``GTest``)
  cannot work well with interactive reloading of plan because there is
  an exception message printed on console. Actually that is not a real
  error because Testplan can only reload Multitest instance but all
  ``ProcessRunnerTest`` uses a binary to execute tests, so if need to
  reload them just replace the binary.
  • Loading branch information
raoyitao authored and Pyifan committed May 17, 2021
1 parent 3991839 commit 6643af9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions testplan/runnable/interactive/reloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from imp import reload

from testplan.common.utils import path as path_utils
from testplan.testing.multitest import suite
from testplan.common.utils import logger
from testplan.common.utils import strings
from testplan.testing.multitest import suite, MultiTest


class ModuleReloader(logger.Loggable):
Expand Down Expand Up @@ -196,13 +196,11 @@ def _suites_by_class(self, tests):
functools.partial(collections.defaultdict, list)
)
for test in tests:
try:
if isinstance(test, MultiTest):
for suite in test.cfg.suites:
suite_dict[suite.__module__][
suite.__class__.__name__
].append(suite)
except AttributeError:
self.logger.exception("Test %r has no suites", test)
return suite_dict

def _reload_modified_modules(self, modified_modules, suite_instances):
Expand Down
1 change: 0 additions & 1 deletion tests/unit/testplan/testing/test_filtering.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest

from testplan.testing.multitest import MultiTest, testsuite, testcase
from testplan.testing.multitest import parametrization

from testplan.testing import filtering

Expand Down

0 comments on commit 6643af9

Please sign in to comment.