diff --git a/doc/source/ray-contribute/getting-involved.rst b/doc/source/ray-contribute/getting-involved.rst index 7b25a75867791..8d7fc33313433 100644 --- a/doc/source/ray-contribute/getting-involved.rst +++ b/doc/source/ray-contribute/getting-involved.rst @@ -105,13 +105,15 @@ The full suite of tests is too large to run on a single machine. However, you ca .. code-block:: shell - pytest -v -s python/ray/tests/test_basic.py + # Directly calling `pytest -v ...` may lose import paths. + python -m pytest -v -s python/ray/tests/test_basic.py This will run all of the tests in the file. To run a specific test, use the following: .. code-block:: shell - - pytest -v -s test_file.py::name_of_the_test + + # Directly calling `pytest -v ...` may lose import paths. + python -m pytest -v -s test_file.py::name_of_the_test Testing for C++ development ~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/python/ray/tune/_structure_refactor.py b/python/ray/tune/_structure_refactor.py index 2333e2f344bda..451d2003f5acd 100644 --- a/python/ray/tune/_structure_refactor.py +++ b/python/ray/tune/_structure_refactor.py @@ -14,16 +14,16 @@ def warn_structure_refactor(old_module: str, new_module: str, direct: bool = Tru if direct: warning += ( - f"Example: Do a global search and " + f" Example: Do a global search and " f"replace `{old_module}` with `{new_module}`." ) else: warning += ( - f"ATTENTION: This module may have been split or refactored. Please " + f"\nATTENTION: This module may have been split or refactored. Please " f"check the contents of `{new_module}` before making changes." ) with warnings.catch_warnings(): warnings.simplefilter("always") - warnings.warn(warning, DeprecationWarning) + warnings.warn(warning, DeprecationWarning, stacklevel=3)