Skip to content

Commit e040ef2

Browse files
authored
Ignore pytest cleanup warning (#19164)
1 parent 5dbfcc2 commit e040ef2

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/tests_fabric/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import warnings
2+
3+
import pytest
4+
5+
# Ignore cleanup warnings from pytest (rarely happens due to a race condition when executing pytest in parallel)
6+
warnings.filterwarnings("ignore", category=pytest.PytestWarning, message=r".*\(rm_rf\) error removing.*")

tests/tests_pytorch/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
import os
15+
import warnings
16+
17+
import pytest
1518

1619
_TEST_ROOT = os.path.dirname(__file__)
1720
_PROJECT_ROOT = os.path.dirname(_TEST_ROOT)
@@ -27,3 +30,7 @@
2730

2831
if not os.path.isdir(_TEMP_PATH):
2932
os.mkdir(_TEMP_PATH)
33+
34+
35+
# Ignore cleanup warnings from pytest (rarely happens due to a race condition when executing pytest in parallel)
36+
warnings.filterwarnings("ignore", category=pytest.PytestWarning, message=r".*\(rm_rf\) error removing.*")

0 commit comments

Comments
 (0)