diff --git a/brian2/tests/test_cpp_standalone.py b/brian2/tests/test_cpp_standalone.py index 84007cde8..90bf3e262 100644 --- a/brian2/tests/test_cpp_standalone.py +++ b/brian2/tests/test_cpp_standalone.py @@ -610,7 +610,16 @@ def test_delete_directory(): assert os.path.isfile(dummy_file) with catch_logs() as logs: device.delete(directory=True) - assert len(logs) == 1 + assert ( + len( + [ + l + for l in logs + if l[1] == "brian2.devices.cpp_standalone.device.delete_skips_directory" + ] + ) + == 1 + ) assert os.path.isfile(dummy_file) with catch_logs() as logs: device.delete(directory=True, force=True)