Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pyproject.toml to setup test discovery #443

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,40 +62,9 @@ jobs:
- run: pip freeze

# Run tests (in parallel)
# TODO(b/326579500): tests should be discovered automatically
- name: Run core tests
run: |
pytest \
torax/config/tests/runtime_params_slice.py \
torax/config/tests/runtime_params.py \
torax/fvm/tests/fvm.py \
torax/sources/tests/bootstrap_current_source.py \
torax/sources/tests/current_density_sources.py \
torax/sources/tests/electron_density_sources.py \
torax/sources/tests/external_current_source.py \
torax/sources/tests/formulas.py \
torax/sources/tests/fusion_heat_source.py \
torax/sources/tests/generic_ion_el_heat_source.py \
torax/sources/tests/ion_el_heat_sources.py \
torax/sources/tests/qei_source.py \
torax/sources/tests/source_models.py \
torax/sources/tests/source.py \
torax/spectators/tests/plotting.py \
torax/spectators/tests/spectator.py \
torax/tests/boundary_conditions.py \
torax/tests/geometry.py \
torax/tests/interpolated_param.py \
torax/tests/jax_utils.py \
torax/tests/math_utils.py \
torax/tests/persistent_cache.py \
torax/tests/physics.py \
torax/tests/test_run_simulation_main.py \
torax/tests/sim_custom_sources.py \
torax/tests/sim_time_dependence.py \
torax/tests/sim.py \
torax/tests/state.py \
torax/transport_model/tests/qlknn_wrapper.py \
torax/transport_model/tests/transport_model.py \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will torax/tests/sim_no_compile.py (referred to below) be handled correctly after this change?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for flagging. It won't but we're working on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(relevant commit 029c24c)

-vv -n auto \
--shard-id=$((${{ matrix.shard-id }} - 1)) --num-shards=${{ env.PYTEST_NUM_SHARDS }}

Expand Down
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,13 @@ include-package-data = true

[tool.setuptools.packages.find]
include = ["torax*"]

[tool.pytest.ini_options]
addopts = [
"--ignore=torax/tests/test_data",
"--ignore=torax/tests/scripts",
"--ignore-glob=*lib*",

]
testpaths = "**/tests"
python_files = "*.py"
File renamed without changes.
29 changes: 0 additions & 29 deletions torax/tests/conftest.py

This file was deleted.