Skip to content

Commit

Permalink
consolidate pytest config in pyproject.toml (#6201)
Browse files Browse the repository at this point in the history
fixes #6194

Wheel tests in this project are emitting tons of warnings like this:

> test_random_forest.py:1247
  /__w/cuml/cuml/python/cuml/cuml/tests/test_random_forest.py:1247: PytestUnknownMarkWarning: Unknown pytest.mark.memleak - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.memleak

I think that's because the introduction of a `pytest.ini` file in #6078 resulted in all of the `pytest` options from `pyproject.toml` being ignored.

From https://docs.pytest.org/en/stable/reference/customize.html#pytest-ini

> pytest.ini files take precedence over other files, even when empty.

I think "take precedence" there means that if `pytest` finds a `pytest.ini`, it stops searching for other configuration files.

Authors:
  - James Lamb (https://github.com/jameslamb)
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Tim Head (https://github.com/betatim)
  - Jake Awe (https://github.com/AyodeAwe)
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #6201
  • Loading branch information
jameslamb authored Jan 9, 2025
1 parent 225d0aa commit 31a609d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 3 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ cpp/ @rapidsai/cuml-cpp-codeowners
python/ @rapidsai/cuml-python-codeowners

#cmake code owners
**/CMakeLists.txt @rapidsai/cuml-cmake-codeowners
**/cmake/ @rapidsai/cuml-cmake-codeowners
python/cuml/pyproject.toml @rapidsai/cuml-cmake-codeowners
build.sh @rapidsai/cuml-cmake-codeowners
**/build.sh @rapidsai/cuml-cmake-codeowners
CMakeLists.txt @rapidsai/cuml-cmake-codeowners
*.cmake @rapidsai/cuml-cmake-codeowners
**/cmake/ @rapidsai/cuml-cmake-codeowners

#CI code owners
/.github/ @rapidsai/ci-codeowners
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,8 @@ cpp/Doxyfile
# clang tooling
compile_commands.json
.clangd/

# generally prefer 'pyproject.toml' to 'pytest.ini' for pytest options
# ref: https://github.com/rapidsai/cuml/pull/6201
pytest.ini
!python/cuml/cuml/benchmark/automated/pytest.ini
5 changes: 0 additions & 5 deletions python/cuml/cuml/tests/pytest.ini

This file was deleted.

2 changes: 2 additions & 0 deletions python/cuml/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ select = [
max_allowed_size_compressed = '1.5G'

[tool.pytest.ini_options]
addopts = "--tb=native"

markers = [
"unit: Quickest tests focused on accuracy and correctness",
"quality: More intense tests than unit with increased runtimes",
Expand Down

0 comments on commit 31a609d

Please sign in to comment.