diff --git a/Makefile b/Makefile index 3bb8b6f..e3b04de 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ pre: .PHONY: debug debug: - pytest -vv tests/tasks/test_re.py + pytest -vv tests/utils/test_logging.py .PHONY: clean clean: diff --git a/README.md b/README.md index 5314038..703d398 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ - Make sure the Python version `>=3.10` (a strict version contraint for better type hinting) ```bash +$ conda install git # upgrade git $ git clone git@github.com:pjlab-sys4nlp/train-moe.git $ cd train-moe $ pip install -e .[dev] diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/utils/test_logging.py b/tests/utils/test_logging.py new file mode 100644 index 0000000..a624f64 --- /dev/null +++ b/tests/utils/test_logging.py @@ -0,0 +1,16 @@ +import pytest + +from smoe.utils.logging import get_logger + + +def err_func(): + return 1 / 0 + + +def test_log(): + logger = get_logger("test") + + +def test_err_func(): + with pytest.raises(ZeroDivisionError): + res = err_func() diff --git a/tox.ini b/tox.ini index d1de3b5..29815a1 100644 --- a/tox.ini +++ b/tox.ini @@ -16,4 +16,5 @@ exclude = # This contains builds of flake8 that we don't want to check dist, bak, - data + data, + outputs