There is a mixture of pytest & Python unittest in here. We adopted pytest later on but didn't migrate existing tests (since they still work). New tests should be written using pytest only.
test_xxx.py: Unittests for the xxx module in the main repo codebase. Modules that are in subdirs normalize the / into _. For example, test_error.py is for the error.py module, and test_subcmds_forall.py is for the subcmds/forall.py module.