IAMconsortium / pyam

Analysis & visualization of energy & climate scenarios
https://pyam-iamc.readthedocs.io/
Apache License 2.0
227 stars 119 forks source link

Test `test_adjusting_logger_level` incompatible with pytest v6.0 #422

Open danielhuppmann opened 4 years ago

danielhuppmann commented 4 years ago

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 commented 4 years ago

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

znicholls commented 4 years ago

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?).

danielhuppmann commented 4 years ago

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.

znicholls commented 4 years ago

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 commented 4 years ago

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

danielhuppmann commented 4 years ago

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.