Merge pull request #492 from c-bata/use-pytest

Use pytest as a test runner
This commit is contained in:
c-bata
2023-06-09 11:33:04 +09:00
committed by GitHub
4 changed files with 15 additions and 7 deletions
+4 -4
View File
@@ -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
+1 -1
View File
@@ -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
+9 -2
View File
@@ -64,13 +64,14 @@ exclude = '''
| build
| dist
| venv
| node_modules
)/
'''
[tool.isort]
profile = 'black'
src_paths = ['optuna', 'tests', 'docs', 'benchmarks']
skip_glob = ['docs/source/conf.py', '**/alembic/versions/*.py', 'tutorial/**/*.py']
src_paths = ['optuna', 'python_tests', 'docs']
skip_glob = ['docs/conf.py']
line_length = 99
lines_after_imports = 2
force_single_line = 'True'
@@ -80,3 +81,9 @@ order_by_type = 'False'
[tool.mypy]
ignore_missing_imports = true
disallow_untyped_defs = true
[tool.pytest.ini_options]
addopts = "--color=yes"
markers = [
"slow: marks tests as slow",
]
+1
View File
@@ -12,6 +12,7 @@ mypy-boto3-s3
mypy
# unit test
pytest
boto3
moto[s3]