From 169965f7f96a3f865de12feb8b3ccf5a1f6da2c0 Mon Sep 17 00:00:00 2001 From: c-bata Date: Fri, 9 Jun 2023 11:23:09 +0900 Subject: [PATCH] Use pytest as a test runner --- .github/workflows/python-tests.yml | 8 ++++---- CONTRIBUTING.md | 2 +- requirements.txt | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 3ba43912..2a8b3d97 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -45,10 +45,10 @@ jobs: # python_tests requires optuna>=3.0.0 since it imports FloatDistribution run: | python -m pip install --progress-bar off --upgrade pip setuptools - pip install boto3 moto[s3] + pip install boto3 moto[s3] pytest pip install --progress-bar off "optuna>=3.0.0" pip install --progress-bar off . - - run: python -m unittest + - run: pytest python_tests test-with-optuna-master: runs-on: ubuntu-latest steps: @@ -61,7 +61,7 @@ jobs: - name: Install dependencies run: | python -m pip install --progress-bar off --upgrade pip setuptools - pip install boto3 moto[s3] + pip install boto3 moto[s3] pytest pip install --progress-bar off . python -m pip install --progress-bar off --upgrade git+https://github.com/optuna/optuna.git - - run: python -m unittest + - run: pytest python_tests diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 241c80d2..034b31cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,7 +76,7 @@ Note that `OPTUNA_DASHBOARD_DEBUG=1` makes the server will automatically restart #### Running Python unit tests ``` -$ python -m unittest +$ pytest python_tests/ ``` #### Running visual regression tests using pyppeteer diff --git a/requirements.txt b/requirements.txt index 25c37877..42be1ff1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,6 +12,7 @@ mypy-boto3-s3 mypy # unit test +pytest boto3 moto[s3]