diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4bb5059..65f96cf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,11 +25,11 @@ jobs: run: | python -m pip install --upgrade pip pip install -e ".[dev]" - pip install coveralls pytest-cov + pip install pytest pytest-cov coveralls - name: Run tests run: | - pytest --cov=mmsbm --cov-report=xml tests/ + PYTHONPATH=$PYTHONPATH:$(pwd) pytest tests/ -v --cov=mmsbm --cov-report=xml - name: Upload coverage to Coveralls env: @@ -37,7 +37,6 @@ jobs: COVERALLS_FLAG_NAME: ${{ matrix.python-version }} COVERALLS_PARALLEL: true run: | - pip install coveralls coveralls --service=github coveralls: diff --git a/pyproject.toml.py b/pyproject.toml.py new file mode 100644 index 0000000..3670f50 --- /dev/null +++ b/pyproject.toml.py @@ -0,0 +1,8 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.pytest.ini_options] +testpaths = ["tests"] +python_files = ["test_*.py"] +addopts = "--cov=mmsbm --cov-report=term-missing" \ No newline at end of file diff --git a/setup.py b/setup.py index 58e9ebc..37fb907 100644 --- a/setup.py +++ b/setup.py @@ -39,6 +39,8 @@ extras_require={ "dev": [ "pytest >= 3.7", + 'pytest-cov', + 'coveralls', ], }, ) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/tests.py b/tests/test_mmsbm.py similarity index 98% rename from tests/tests.py rename to tests/test_mmsbm.py index 0a27ca0..280b1a5 100644 --- a/tests/tests.py +++ b/tests/test_mmsbm.py @@ -2,7 +2,7 @@ import pandas as pd import numpy as np -from src.mmsbm import MMSBM +from mmsbm import MMSBM RATING_NUM = 100