Title: increase logging handlers test coverage
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.2
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: Tom, belopolsky, brian.curtin, r.david.murray, vinay.sajip
Priority: normal Keywords: patch

Created on 2010-07-31 17:26 by Tom, last changed 2011-02-26 15:36 by vinay.sajip. This issue is now closed.

File name Uploaded Description Edit
rotating_file_handlers.patch Tom, 2010-07-31 17:26 regression tests for logging handlers
rotating_file_handlers.patch Tom, 2010-08-01 17:42 regression tests for logging handlers (2)
Messages (10)
msg112171 - (view) Author: Tom Dunham (Tom) Date: 2010-07-31 17:26
Some regression tests for logging handlers, brings coverage up from 37% to 52%. Mainly tests to rotating file handlers.
msg112346 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-08-01 15:36
I noticed that you use timedelta.total_seconds in secs which returns a float while no test covers fractional number of seconds.  While not a problem with your choice of tests, equality comparison of floating point values commonly leads to fragile tests.  I would suggest that you use delta//timedelta(seconds=1) instead of total_seconds().
msg112361 - (view) Author: Tom Dunham (Tom) Date: 2010-08-01 17:42
Good point, thank you. I've updated the patch.
msg114729 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-08-23 08:30
Tom, thanks for the patch. If I apply it I get an error at shutdown when run with the command

python3.2 test_logging test_logging

i.e. when I run test_logging twice. If I use

python3.2 test_logging

there are no errors. I haven't had time to look into it - please can you check that everything is cleaned up so that there are no shutdown errors? Thanks.
msg116711 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-09-17 19:00
Okay, the tests now pass and I've committed the path to py3k (r84864). Thanks, Tom and Alexander.
msg116713 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-09-17 19:28
It looks like we are getting buildbot failures as a result of this checkin: Ubuntu 3.x/builds/2216/steps/test/logs/stdio
msg116741 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-09-17 23:39
Okay, I've temporarily commented out TimedRotatingFileHandlerTest tests, while I investigate further. Let's see how the buildbots cope now.
msg117458 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-09-27 18:15
It would be nice to see tests for NTEventLogHandler, as there are currently none.

I looked into implementing NTEventLogHandler's Win32 calls in a C extension rather than requiring a third-party module, but stopped once I realized there weren't any tests. I may get to it myself, but I thought I'd throw this out there.
msg117506 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-09-28 07:13
You're right about there not being tests, but if there had been, they would be using the PyWin32 libraries as well and so would need to be reimplemented (if the purpose is to remove the dependency).

Perhaps ctypes would be an alternative implementation approach. Certainly the code has hardly been touched since the initial release, and I would guess that it gets used a fair amount.

I'm not sure to what extent the external dependency is a practical problem: I would guess a large number of Windows users would be using the ActiveState distribution, which includes this dependency.

Of course I'm not saying any of this as an excuse for not having tests :-)
msg129562 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2011-02-26 15:36
Fix checked into release32-maint (r88651).
Date User Action Args
2011-02-26 15:36:52vinay.sajipsetstatus: open -> closed
nosy: vinay.sajip, belopolsky, r.david.murray, brian.curtin, Tom
messages: + msg129562

resolution: accepted -> fixed
stage: commit review -> resolved
2010-09-28 07:13:07vinay.sajipsetmessages: + msg117506
2010-09-27 18:15:04brian.curtinsetnosy: + brian.curtin
messages: + msg117458
2010-09-17 23:39:25vinay.sajipsetresolution: fixed -> accepted
messages: + msg116741
stage: resolved -> commit review
2010-09-17 19:28:15r.david.murraysetstatus: closed -> open
nosy: + r.david.murray
messages: + msg116713

2010-09-17 19:00:05vinay.sajipsetstatus: open -> closed
type: enhancement
messages: + msg116711

resolution: fixed
stage: resolved
2010-08-23 08:30:32vinay.sajipsetmessages: + msg114729
2010-08-22 18:53:17vinay.sajipsetassignee: vinay.sajip

nosy: + vinay.sajip
2010-08-01 17:42:55Tomsetfiles: + rotating_file_handlers.patch

messages: + msg112361
2010-08-01 15:36:39belopolskysetnosy: + belopolsky
messages: + msg112346
components: + Tests, - Library (Lib)
2010-07-31 17:26:18Tomcreate