Fixed #19546 - ensure that deprecation warnings are shown during tests

refs #18985