Skip to content

Unit Tests

Adi Ahmad Danish edited this page Feb 10, 2024 · 3 revisions

Overview

This section is for documenting the general structure, procedures and steps for writing a unit test for the malaya library.

Prerequisites

Note: Make sure you're running in a virtual environment! See venv for details.

Before you write any unit tests and run them, make sure to install the malaya library first. You may need to install numpy as well. If some tests fail, try installing youtokentome and fasttext. These are the libraries included in the requirements.txt and you can install it with:

pip3 install -r requirements.txt

Unit tests are used to test the smallest functional piece of code. The test files are available in the tests/tests directory.

Writing a Unit Test

Refer to the Pytest Documentation, files should begin with 'test'.

Running the Unit Tests

For basic commands, refer to the README in the tests directory.