test_main.py: test_debug_0 fails
See original GitHub issueHi,
While packaging 1.2.2 in Debian, I met failures in the test phase with test_debug_0.
Indeed, the assertion fails: the effective level of the logger after the run of main((‘-n’,)) is ERROR and not WARNING as expected.
I can reproduce the behaviour in any ipython3 shell in 3.9 and 3.7:
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
Type "copyright", "credits" or "license" for more information.
IPython 5.8.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import logging
In [2]: s = logging.getLogger('mail.log')
In [3]: s
Out[3]: <Logger mail.log (WARNING)>
In [4]: logging.basicConfig(level=logging.ERROR)
In [5]: s
Out[5]: <Logger mail.log (ERROR)>
What am I missing here?
Cheers!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
go - TestMain - no tests to run - Stack Overflow
#1. Trying to run TestMain() is like trying to run main() . You don't do that, the OS does this for you. TestMain...
Read more >"TestMain(m *testing.M)" runs as a test itself but is failing
I'm using a file main_test.go to run my tests. There are 4 tests total but my run tells me that 1 test failed...
Read more >Why use TestMain for testing in Go? - Medium
The TestMain function was released with Go 1.4 about 2 years ago and I feel like it is still not used enough. ......
Read more >unittest — Unit testing framework — Python 3.11.1 ...
If the test fails, an exception will be raised with an explanatory message, and unittest will identify the test case as a failure....
Read more >Getting Started With Testing in Python
Handling Expected Failures ; Isolating Behaviors in Your Application; Writing Integration Tests; Testing Data-Driven Applications.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@pepoluan No worries for me to close the bug, I was just asking in case you had an idea about what could be the cause of the failure. I use pytest now for these tests! 😃
Thanks for taking the time to answer!
Well, considering that
I’m going to close this issue.
Feel free to reopen if you think this is important and aiosmtpd can do something about this.