Class usage came from the unittest framework and it was always redundant
after migration to the pytest. This commit removes classes from files
containing tests to make them more readable and understandable.
Prerequisites check moved to the module level to simplify class structure.
Discovery and prerequisites checks functions moved to the separate files.
Introduced "require" fixture to provide per-test requirements check.
Common methods from applications/proto.py converted to the fixtures.
sysctl check moved to the specific file where it is using.
Some options moved to the constructor to have early access.
Previously, it was necessary to support older versions of Python for
compatibility. F-strings were released in Python 3.6. Python 3.5 was
marked as unsupported by the end of 2020, so now it's possible to start
using f-strings safely for better readability and performance.
Added the following command line arguments:
-d, --detailed: Show detailed output for tests
Usage examples:
./test/run.py --detailed
python3 test/test_access_log.py --detailed
python3 test/test_access_log.py -d TestUnitAccessLog.test_access_log_ipv6
-l, --log: Save unit.log after the test execution
Usage examples:
./test/run.py -l
python3 test/test_access_log.py -l
python3 test/test_access_log.py --log TestUnitAccessLog.test_access_log_ipv6