You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ x] I have read the Filing Issues and subsequent “How to Get Help” sections of the documentation.
[ x ] I have searched the issues (including closed ones) and believe that this is not a duplicate.
Issue
In my egberts/pelican at master-egbert branch, latest everything, in the test_log is all of a sudden now failing the LimitFilter portion of test_log.py.
Despite the test_log properly inserting the LimitFilter (and unchanged for the last 4 years, @avaris ), yet our Pelican lone solitary test_log.py unit test is now failing.
Something have gotten changed (might be me and my massive PR smash-together).
pytest
$ pytest tests/test_log.py Test session starts (platform: linux, Python 3.11.2, pytest 8.2.2, pytest-sugar 1.0.0)rootdir: /home/wolfe/admin/websites/egbert.net/pelicanconfigfile: tox.iniplugins: xdist-3.6.1, anyio-4.4.0, sugar-1.0.06 workers [1 item] collecting ... ――――――――――――――――――――――――――― TestLog.test_log_filter ――――――――――――――――――――――――――――[gw0] linux -- Python 3.11.2 /home/wolfe/virtualenvs/pelican/bin/pythonself = <pelican.tests.test_log.TestLog testMethod=test_log_filter> def test_log_filter(self): def do_logging(): for i in range(5): self.logger.warning("Log %s", i) self.logger.warning("Another log %s", i) # no filter with self.reset_logger(): do_logging() self.assertEqual(self.handler.count_logs("Log \\d", logging.WARNING), 5) self.assertEqual( self.handler.count_logs("Another log \\d", logging.WARNING), 5 ) # filter by template with self.reset_logger(): log.LimitFilter._ignore.add((logging.WARNING, "Log %s")) do_logging()
> self.assertEqual(self.handler.count_logs("Log \\d", logging.WARNING), 0)E AssertionError: 5 != 0tests/test_log.py:53: AssertionError----------------------------- Captured stdout call -----------------------------[13:43:02] WARNING Log 0 test_log.py:38 WARNING Another log 0 test_log.py:39 WARNING Log 1 test_log.py:38 WARNING Another log 1 test_log.py:39 WARNING Log 2 test_log.py:38 WARNING Another log 2 test_log.py:39 WARNING Log 3 test_log.py:38 WARNING Another log 3 test_log.py:39 WARNING Log 4 test_log.py:38 WARNING Another log 4 test_log.py:39 WARNING Log 0 test_log.py:38 WARNING Another log 0 test_log.py:39 WARNING Log 1 test_log.py:38 WARNING Another log 1 test_log.py:39 WARNING Log 2 test_log.py:38 WARNING Another log 2 test_log.py:39 WARNING Log 3 test_log.py:38 WARNING Another log 3 test_log.py:39 WARNING Log 4 test_log.py:38 WARNING Another log 4 test_log.py:39------------------------------ Captured log call -------------------------------WARNING pelican.tests.test_log:test_log.py:38 Log 0WARNING pelican.tests.test_log:test_log.py:39 Another log 0WARNING pelican.tests.test_log:test_log.py:38 Log 1WARNING pelican.tests.test_log:test_log.py:39 Another log 1WARNING pelican.tests.test_log:test_log.py:38 Log 2WARNING pelican.tests.test_log:test_log.py:39 Another log 2WARNING pelican.tests.test_log:test_log.py:38 Log 3WARNING pelican.tests.test_log:test_log.py:39 Another log 3WARNING pelican.tests.test_log:test_log.py:38 Log 4WARNING pelican.tests.test_log:test_log.py:39 Another log 4WARNING pelican.tests.test_log:test_log.py:38 Log 0WARNING pelican.tests.test_log:test_log.py:39 Another log 0WARNING pelican.tests.test_log:test_log.py:38 Log 1WARNING pelican.tests.test_log:test_log.py:39 Another log 1WARNING pelican.tests.test_log:test_log.py:38 Log 2WARNING pelican.tests.test_log:test_log.py:39 Another log 2WARNING pelican.tests.test_log:test_log.py:38 Log 3WARNING pelican.tests.test_log:test_log.py:39 Another log 3WARNING pelican.tests.test_log:test_log.py:38 Log 4WARNING pelican.tests.test_log:test_log.py:39 Another log 4 pelican/tests/test_log.py ⨯ 100% ██████████=========================== short test summary info ============================FAILED tests/test_log.py::TestLog::test_log_filter - AssertionError: 5 != 0Results (0.89s): 1 failed - pelican/tests/test_log.py:35 TestLog.test_log_filter
Found it.... My introduction of pelican/pelican/tests/conftest.py caused the logger to have dual-personality (despite no logging import statement inside conftest.py): as a result, the logger.getLevel() produces two different values between Pelican __init__.py and log.py.
Very interesting....
egberts
changed the title
test_log.py failed; logging upgraded? Missing _ignore field
test_log.py failed during LimitFilterJul 24, 2024
Issue
In my egberts/pelican at master-egbert branch, latest everything, in the test_log is all of a sudden now failing the
LimitFilter
portion oftest_log.py
.Despite the
test_log
properly inserting theLimitFilter
(and unchanged for the last 4 years, @avaris ), yet our Pelican lone solitarytest_log.py
unit test is now failing.Something have gotten changed (might be me and my massive PR smash-together).
pytest
logging.addFilter
works and properly added:Pelican's
log.LimitFilter._ignore
has the correct value:But the
_ignore
field seems to be ignored.Platform
OS version and name: Linux 6.1.0-21-amd64 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux
Python version: 3.11.2
Pelican version:
master-egbert
branch in github.com/egberts/pelicanLink to theme: custom m.css
Links to plugins: None
Link to your site: N/A
Link to your source: https://github.com/egberts/pelican/tree/master-egbert
Link to a Gist with the contents of your settings file: none (
DEFAULT_CONFIG
)The text was updated successfully, but these errors were encountered: