Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
223349cf
Commit
223349cf
authored
Oct 01, 2015
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #25097: Windows test is skipped if there are insufficient privileges, rather than failing.
parent
f223c532
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
Lib/test/test_logging.py
Lib/test/test_logging.py
+11
-9
No files found.
Lib/test/test_logging.py
View file @
223349cf
...
@@ -65,14 +65,10 @@ try:
...
@@ -65,14 +65,10 @@ try:
except
ImportError
:
except
ImportError
:
threading
=
None
threading
=
None
try
:
try
:
import
win32evtlog
import
win32evtlog
,
win32evtlogutil
,
pywintypes
except
ImportError
:
except
ImportError
:
win32evtlog
=
None
win32evtlog
=
win32evtlogutil
=
pywintypes
=
None
try
:
import
win32evtlogutil
except
ImportError
:
win32evtlogutil
=
None
win32evtlog
=
None
try
:
try
:
import
zlib
import
zlib
except
ImportError
:
except
ImportError
:
...
@@ -4098,13 +4094,19 @@ for when, exp in (('S', 1),
...
@@ -4098,13 +4094,19 @@ for when, exp in (('S', 1),
setattr(TimedRotatingFileHandlerTest, "
test_compute_rollover_
%
s
" % when, test_compute_rollover)
setattr(TimedRotatingFileHandlerTest, "
test_compute_rollover_
%
s
" % when, test_compute_rollover)
@unittest.skipUnless(win32evtlog, 'win32evtlog/win32evtlogutil required for this test.')
@unittest.skipUnless(win32evtlog, 'win32evtlog/win32evtlogutil
/pywintypes
required for this test.')
class NTEventLogHandlerTest(BaseTest):
class NTEventLogHandlerTest(BaseTest):
def test_basic(self):
def test_basic(self):
logtype = 'Application'
logtype = 'Application'
elh = win32evtlog.OpenEventLog(None, logtype)
elh = win32evtlog.OpenEventLog(None, logtype)
num_recs = win32evtlog.GetNumberOfEventLogRecords(elh)
num_recs = win32evtlog.GetNumberOfEventLogRecords(elh)
h = logging.handlers.NTEventLogHandler('test_logging')
try:
h = logging.handlers.NTEventLogHandler('test_logging')
except pywintypes.error as e:
if e[0] == 5: # access denied
raise unittest.SkipTest('Insufficient privileges to run test')
r = logging.makeLogRecord({'msg': 'Test Log Message'})
r = logging.makeLogRecord({'msg': 'Test Log Message'})
h.handle(r)
h.handle(r)
h.close()
h.close()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment