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
481c6dd7
Commit
481c6dd7
authored
Oct 14, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #18919: Fixed resource leaks in audio tests.
parents
1f56a94a
85812bca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
Lib/test/audiotests.py
Lib/test/audiotests.py
+12
-12
No files found.
Lib/test/audiotests.py
View file @
481c6dd7
...
...
@@ -191,18 +191,18 @@ class AudioTestsWithSourceFile(AudioTests):
self
.
sndfilenframes
,
self
.
comptype
,
self
.
compname
)
def
test_close
(
self
):
testfile
=
open
(
self
.
sndfilepath
,
'rb'
)
f
=
self
.
f
=
self
.
module
.
open
(
testfile
)
self
.
assertFalse
(
testfile
.
closed
)
f
.
close
()
self
.
assertEqual
(
testfile
.
closed
,
self
.
close_fd
)
testfile
=
open
(
TESTFN
,
'wb'
)
fout
=
self
.
module
.
open
(
testfile
,
'wb'
)
self
.
assertFalse
(
testfile
.
closed
)
with
self
.
assertRaises
(
self
.
module
.
Error
):
fout
.
close
()
self
.
assertEqual
(
testfile
.
closed
,
self
.
close_fd
)
fout
.
close
()
# do nothing
with
open
(
self
.
sndfilepath
,
'rb'
)
as
testfile
:
f
=
self
.
f
=
self
.
module
.
open
(
testfile
)
self
.
assertFalse
(
testfile
.
closed
)
f
.
close
()
self
.
assertEqual
(
testfile
.
closed
,
self
.
close_fd
)
with
open
(
TESTFN
,
'wb'
)
as
testfile
:
fout
=
self
.
fout
=
self
.
module
.
open
(
testfile
,
'wb'
)
self
.
assertFalse
(
testfile
.
closed
)
with
self
.
assertRaises
(
self
.
module
.
Error
):
fout
.
close
()
self
.
assertEqual
(
testfile
.
closed
,
self
.
close_fd
)
fout
.
close
()
# do nothing
def
test_read
(
self
):
framesize
=
self
.
nchannels
*
self
.
sampwidth
...
...
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