diff --git a/doc/en/assertions.rst b/doc/en/assertions.rst index e22ca4e3c..a5dcafcf2 100644 --- a/doc/en/assertions.rst +++ b/doc/en/assertions.rst @@ -25,16 +25,16 @@ a testcase, because it avoids the typical problem of fixing one assertion simply to find another one later on. If some assertions rely on the result of previous ones and does not make sense -to be executed if the previous failed, their boolean return values can be used -like this example: +to be executed if the previous failed, the ``passed`` attribute of the returned +assertion entry can be used like this example: .. code-block:: python @testcase def sample_testcase(self, env, result): item = get_item() - passed = result.true(isinstance(item, dict), description='Check if dict') - if passed is True: + entry = result.true(isinstance(item, dict), description='Check if dict') + if entry.passed is True: result.contain('key', item.keys(), description='.keys() used') If the test should be stopped on an assertion failure, an exception can be raised @@ -44,9 +44,9 @@ or use a *return* statement like this example: @testcase def sample_testcase(self, env, result): - passed = result.true(isinstance(5, float), description='Check if float') + entry = result.true(isinstance(5, float), description='Check if float') - if passed is False: + if entry.passed is False: raise RuntimeError('5 is not a float.') # Or result.log('5 is not a float. Aborting testcase.') diff --git a/doc/en/interactive.rst b/doc/en/interactive.rst index c32a34319..6971b5bd8 100644 --- a/doc/en/interactive.rst +++ b/doc/en/interactive.rst @@ -63,8 +63,8 @@ circumstances. * ``__main__`` module (i.e. test_plan.py) cannot be reloaded. Because of this, it is recommended that test suites are defined in seperate modules. It is a good idea to keep the main script simple. -* Testplan is not able to reload module that is under *Namespace Package*, the - workaround is to add dummy __init__.py file. +* Testplan is not able to reload module that is under **Namespace Package**, the + workaround is to add dummy ``__init__.py`` file. * Unlike testcases that can be added/removed/modified, adding/removing/renaming testsuite class will not take effect after reloading. * Modules or objects imported using ``from some_module import *`` syntax are @@ -73,6 +73,17 @@ circumstances. * In interactive mode, all modules containing test targets will be loaded at the same time, if the modules from which tasks are scheduled have the same name, they won't be reloaded properly. +* `modulefinder.ModuleFinder `_ + works purely on static analysis, which means it can handle the following cases + in the current module: + + * Absolute import from the top-level package containing the current module. + * Relative import from the current module to its sibling modules. + + It is completely ignorant of any programmatic import as well as import + requiring ``sys.path`` manipulation. Such dependencies will not be included + in the graph thus not reloaded. User can use the ``extra_deps`` parameter of + the ``@test_plan`` decorator to specify these dependencies manually. .. _Interactive_UI: