pyam icon indicating copy to clipboard operation
pyam copied to clipboard

Test `test_adjusting_logger_level` incompatible with pytest v6.0

Open danielhuppmann opened this issue 3 years ago • 6 comments

The behaviour of the logger in test_adjusting_logger_level is incompatible with (at least) pytest v6.0.0 and pytest v6.0.1. Per #421, the version of pytest is pinned to an earlier version. This should be revisited in the future if it is a bug in pytest or if the log-level-adjustment needs to be updated.

danielhuppmann avatar Aug 12 '20 19:08 danielhuppmann

@znicholls FYI because you implemented the logging tests...

danielhuppmann avatar Aug 12 '20 19:08 danielhuppmann

Thanks. I doubt it’ll be a bug in pytest. I can update the test whenever unpinning pytest becomes urgent, just let me know (is there any other reason pytest is pinned or is it just the logging tests?).

znicholls avatar Aug 12 '20 21:08 znicholls

The pytest docs for caplog.at_level() don't indicate that the test of the logger here should not work as before - but it seems (as of v6.0) to change the log-level of all loggers, not just "pyam.core"...

This is the only failure preventing to use the latest version of pytest.

danielhuppmann avatar Aug 16 '20 11:08 danielhuppmann

Ok I'm pretty sure this is a bug introduced by https://github.com/pytest-dev/pytest/commit/fcbaab8b0b89abc622dbfb7982cf9bd8c91ef301 (this team is having the same problem https://github.com/adobe-type-tools/psautohint/pull/264). It's not going to be super easy to fix so I would say, either a) leave pytest pinned or b) xfail the test for now and we can undo it once I've worked out what is going on with pytest.

znicholls avatar Aug 16 '20 23:08 znicholls

See https://github.com/pytest-dev/pytest/issues/7656

znicholls avatar Aug 16 '20 23:08 znicholls

thanks @znicholls for investigating and raising the issue with the pytest devs!

Let's keep the dependency pinned for now and hope that they'll fix it in the not-too-distant future.

danielhuppmann avatar Aug 17 '20 06:08 danielhuppmann