Muscat.Helpers.Check module

Testing infrastructure for Muscat and extra modules

Developer documentation:

all the import statements are placed after the treatment of the user option “-y” (dont_write_bytecode). So no pyc are created prior the default behavior

CheckIfAllThePresentFilesAreTested(extraToolsBoxes, testedFiles) None[source]
CheckIntegrity() str[source]
GetDefaultOptions(**kwargs)[source]
RunTests() int[source]

Base function to run all tests, all the option are captured from the command line arguments. this function is intended to be used by the user

python Muscat.Helper.Check.py -c -f -s -e <extraModules> -m <moduleFilter> python -m Muscat.Helper.Check -c -f -s -e <extraModules> -m <moduleFilter>

options :
-f

Full output for all the test

-v

Activate maximal level of verbosity (implied -f)

-s

Stop at first error

-e

To test extra Modules (-e can be repeated)

-m

To filter the output by this string (-m can be repeated)

-k

Skip test base on string

-d

Dry run do not execute anything, only show what will be executed

-c

To activate coverage and generate a html report -cb (coverage with browser and local file index.html generated) for correct platform dependent coverage you can use the following comment to disconnect coverage in some platform:

# only nt coverage
# only posix coverage
-l

Generation of the coverage (html) report locally (current path)

-b

Launch browser after the coverage report generation

-p

Activate profiling

-t

use mypy to check the typing of every module

-y

Generate .pyc when importing modules (default False)

-L

Output Locally, Use the current path for all the outputs

-P

<dir> Set temporary output directory to

-g

to use the Froze decorator during testing

Returns:

return the number of failed tests

Return type:

int

TestAll(modulesToTreat: List[str] = ['ALL'], modulesToSkip: List = [], extraToolsBoxes: List[str] | None = None, options=None) Dict[source]

Core function to test every module present

Parameters:
  • modulesToTreat (list, optional) – List of modules to test , by default [‘ALL’] means all the modules in the current toolbox

  • modulesToSkip (list, optional) – List of modules to skip every entry is a string used in a find to filter the modules to test, by default []

  • stopAtFirstError (bool, optional) – Stop at first error encountered, by default False

  • extraToolsBoxes (List[str], optional) – name of the extra libraries to test, by default None, this means “Muscat”

  • dryRun (bool, optional) – to just print the code to be executed, by default False

  • profiling (bool, optional) – activate the profiling of the tests, by default False

  • coverage (Dict, optional) – argument to control the coverage checking, by default None

  • typing (bool, optional) – activate the typing checking, by default False

Returns:

_description_

Return type:

Dict