From 2ebcefae46a07c6a188d1ee6bbbaab7ff5c92e54 Mon Sep 17 00:00:00 2001 From: Michael Opdenacker Date: Wed, 6 Dec 2023 16:45:21 +0100 Subject: [PATCH] test-manual: add links to python unittest Better than using "python unittest" without any special formatting. (From yocto-docs rev: 544cc1f950445d2c103c9adfa9147af1513b7a14) Signed-off-by: Michael Opdenacker Signed-off-by: Steve Sakoman --- documentation/test-manual/intro.rst | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/documentation/test-manual/intro.rst b/documentation/test-manual/intro.rst index 51934f4851..811dfca4be 100644 --- a/documentation/test-manual/intro.rst +++ b/documentation/test-manual/intro.rst @@ -200,8 +200,8 @@ Tests map into the codebase as follows: $ bitbake-selftest bb.tests.data.TestOverrides.test_one_override - The tests are based on `Python - unittest `__. + The tests are based on + `Python unittest `__. - *oe-selftest:* @@ -214,7 +214,8 @@ Tests map into the codebase as follows: in the same thread. To parallelize large numbers of tests you can split the class into multiple units. - - The tests are based on Python unittest. + - The tests are based on + `Python unittest `__. - The code for the tests resides in ``meta/lib/oeqa/selftest/cases/``. @@ -333,21 +334,24 @@ A simple test example from ``lib/bb/tests/data.py`` is:: val = self.d.expand("${foo}") self.assertEqual(str(val), "value_of_foo") -In this example, a ``DataExpansions`` class of tests is created, -derived from standard python unittest. The class has a common ``setUp`` -function which is shared by all the tests in the class. A simple test is -then added to test that when a variable is expanded, the correct value -is found. +In this example, a ``DataExpansions`` class of tests is created, derived from +standard `Python unittest `__. +The class has a common ``setUp`` function which is shared by all the tests in +the class. A simple test is then added to test that when a variable is +expanded, the correct value is found. -Bitbake selftests are straightforward python unittest. Refer to the -Python unittest documentation for additional information on writing -these tests at: https://docs.python.org/3/library/unittest.html. +BitBake selftests are straightforward +`Python unittest `__. +Refer to the `Python unittest documentation +`__ for additional information +on writing such tests. ``oe-selftest`` --------------- These tests are more complex due to the setup required behind the scenes -for full builds. Rather than directly using Python's unittest, the code +for full builds. Rather than directly using `Python unittest +`__, the code wraps most of the standard objects. The tests can be simple, such as testing a command from within the OE build environment using the following example::