This has the benefical side-effect of not calling the original
warnings.showwarnings function, which in its original form
only writes the formatted warning to sys.stdout.
Calling the original warnings.showwarnings has the effect that nested WarningsRecorder all catch the warnings:
with WarningsRecorder() as rec1:
with WarningsRecorder() as rec2:
warnings.warn(UserWarning, 'some warning')
(both rec1 and rec2 sees the warning)
When running tests with `testdir`, the main pytest session would then see the warnings created by
the internal code being tested (if any), and the main pytest session would end up with warnings as well.