-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
MUnit tests often requires time consuming preparation ( e.g. starting an application, create design), which not all test cases want to do each time in their setup. Same situation exist for cleanups ( close applications, delete designs) and test case teardown.
Other frameworks like pytest allows to define not only for the test itself a setup / teardown, even for suites and run sessions pytest - Fixture scopes
Question is, which concept has MUnit for this?
Checking the one_time_set_up() and one_time_tear_down() functions shows, that these steps are not executed in each run. It requires that a run with other test classes are executed before or afterwards.
- one_time_tear_down() is only executed, when another test class is running afterwards
- one_time_set_up() is only executed, when another test class is running afterwards
- sample code see one_time_munit_samples.magik
MagikSF> one_time_munit_sample_01.run()
$
one_time_munit_sample_01.one_time_set_up()
one_time_munit_sample_01.set_up()
test_sample_1()
one_time_munit_sample_01.tear_down()
one_time_munit_sample_01.set_up()
test_sample_3()
one_time_munit_sample_01.tear_down()
a sw:mtest_result
MagikSF> one_time_munit_sample_01.run()
$
one_time_munit_sample_01.set_up()
test_sample_1()
one_time_munit_sample_01.tear_down()
one_time_munit_sample_01.set_up()
test_sample_3()
one_time_munit_sample_01.tear_down()
a sw:mtest_result
MagikSF> one_time_munit_sample_02.run()
$
one_time_munit_sample_01.one_time_tear_down()
one_time_munit_sample_02.one_time_set_up()
one_time_munit_sample_02.set_up()
test_sample_2()
one_time_munit_sample_02.tear_down()
one_time_munit_sample_02.set_up()
test_sample_4()
one_time_munit_sample_02.tear_down()
a sw:mtest_result
MagikSF> one_time_munit_sample_01.run()
$
one_time_munit_sample_02.one_time_tear_down()
one_time_munit_sample_01.one_time_set_up()
one_time_munit_sample_01.set_up()
test_sample_1()
one_time_munit_sample_01.tear_down()
one_time_munit_sample_01.set_up()
test_sample_3()
one_time_munit_sample_01.tear_down()
a sw:mtest_result
Metadata
Metadata
Assignees
Labels
No labels