Skip to content

Latest commit

 

History

History
 
 

tests

Unit Tests

To run the unittests, use the following command

python3 -m pytest --device="cpu" .

To test for certain file, e.g., the test_models_transformer.py, use the following command

python3 -m pytest --device="cpu" test_models_transformer.py

To test only for gpu device, use the following command

python3 -m pytest --device="gpu" test_models_transformer.py

To test both for cpu and gpu device, use the following command

python3 -m pytest --device="cpu" --device="gpu" test_models_transformer.py

Refer to the official guide of pytest for more details.

Naming Convention

The naming convention of the tests are test_{module_name}.py. For example, the test of models/transformer.py will be in test_models_transformer.py. The test of models/init.py is test_models.py.