diff --git a/lib/matplotlib/tests/test_matplotlib.py b/lib/matplotlib/tests/test_matplotlib.py index 8bbbd2cff806..200bcaef1e02 100644 --- a/lib/matplotlib/tests/test_matplotlib.py +++ b/lib/matplotlib/tests/test_matplotlib.py @@ -9,6 +9,8 @@ @pytest.mark.skipif( os.name == "nt", reason="chmod() doesn't work as is on Windows") +@pytest.mark.skipif(os.name != "nt" and os.geteuid() == 0, + reason="chmod() doesn't work as root") def test_tmpconfigdir_warning(tmpdir): """Test that a warning is emitted if a temporary configdir must be used.""" mode = os.stat(tmpdir).st_mode