Skip to content

Commit 9eae959

Browse files
authored
[MNT] Move pytest configuration to pyproject.toml (#1851)
### Description Consolidated pytest configuration into pyproject.toml for better structure and to comply with modern Python tooling practices. Removed pytest.ini as it is no longer needed after the migration.
1 parent cfc7fc6 commit 9eae959

File tree

2 files changed

+28
-30
lines changed

2 files changed

+28
-30
lines changed

pyproject.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,31 @@ ignore_missing_imports = true
210210
no_implicit_optional = true
211211
check_untyped_defs = true
212212
cache_dir = ".cache/mypy/"
213+
214+
[tool.pytest.ini_options]
215+
addopts = [
216+
"-rsxX",
217+
"-vv",
218+
"--cov-config=.coveragerc",
219+
"--cov=pytorch_forecasting",
220+
"--cov-report=html",
221+
"--cov-report=term-missing:skip-covered",
222+
"--no-cov-on-fail"
223+
]
224+
markers = []
225+
testpaths = ["tests/", "pytorch_forecasting/tests/"]
226+
log_cli_level = "ERROR"
227+
log_format = "%(asctime)s %(levelname)s %(message)s"
228+
log_date_format = "%Y-%m-%d %H:%M:%S"
229+
cache_dir = ".cache"
230+
filterwarnings = [
231+
"ignore:Found \\d+ unknown classes which were set to NaN:UserWarning",
232+
"ignore:Less than \\d+ samples available for \\d+ prediction times. Use ba:UserWarning",
233+
"ignore:scale is below 1e-7 - consider not centering the data or using data with:UserWarning",
234+
"ignore:You defined a `validation_step` but have no `val_dataloader`:UserWarning",
235+
"ignore:ReduceLROnPlateau conditioned on metric:RuntimeWarning",
236+
"ignore:The number of training samples \\(\\d+\\) is smaller than the logging interval Trainer\\(:UserWarning",
237+
"ignore:The dataloader, [\\_\\s]+ \\d+, does not have many workers which may be a bottleneck.:UserWarning",
238+
"ignore:Consider increasing the value of the `num_workers` argument`:UserWarning",
239+
"ignore::UserWarning"
240+
]

pytest.ini

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)