using asynchronous tests with Eventually in a testscript with runtests
古いコメントを表示
The Eventually-method is great for testing time-related checks without having to wait a fixed sufficiently-high amount of time, but how do I get it working in a testscript with runtests.m, without rewriting my tests from a test-script to a test-class?
Minimum working example:
myTests.m:
import matlab.unittest.TestCase
import matlab.unittest.constraints.Eventually
import matlab.unittest.constraints.IsGreaterThan
testCase = TestCase.forInteractiveUse;
tic
testCase.verifyThat(@toc,Eventually(IsGreaterThan(1)))
When I run the tests as below, it crashes
runtests("myTests.m")
with the following short error (full error further down in comment):
Error using matlab.unittest.TestCase.forInteractiveUse
Unable to create an interactive TestCase while running a test.
Error in myTests (line 7)
testCase = TestCase.forInteractiveUse;
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Testing Frameworks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!