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
355dda8d
Commit
355dda8d
authored
Oct 15, 2013
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Plain Diff
Issue #14407: Fix unittest test discovery in test_concurrent_futures.
parents
acc9f3fb
9816a1e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
22 deletions
+15
-22
Lib/test/test_concurrent_futures.py
Lib/test/test_concurrent_futures.py
+13
-22
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_concurrent_futures.py
View file @
355dda8d
...
@@ -94,7 +94,7 @@ class ProcessPoolMixin(ExecutorMixin):
...
@@ -94,7 +94,7 @@ class ProcessPoolMixin(ExecutorMixin):
executor_type
=
futures
.
ProcessPoolExecutor
executor_type
=
futures
.
ProcessPoolExecutor
class
ExecutorShutdownTest
(
unittest
.
TestCase
)
:
class
ExecutorShutdownTest
:
def
test_run_after_shutdown
(
self
):
def
test_run_after_shutdown
(
self
):
self
.
executor
.
shutdown
()
self
.
executor
.
shutdown
()
self
.
assertRaises
(
RuntimeError
,
self
.
assertRaises
(
RuntimeError
,
...
@@ -122,7 +122,7 @@ class ExecutorShutdownTest(unittest.TestCase):
...
@@ -122,7 +122,7 @@ class ExecutorShutdownTest(unittest.TestCase):
f
.
result
()
f
.
result
()
class
ThreadPoolShutdownTest
(
ThreadPoolMixin
,
ExecutorShutdownTest
):
class
ThreadPoolShutdownTest
(
ThreadPoolMixin
,
ExecutorShutdownTest
,
unittest
.
TestCase
):
def
_prime_executor
(
self
):
def
_prime_executor
(
self
):
pass
pass
...
@@ -154,7 +154,7 @@ class ThreadPoolShutdownTest(ThreadPoolMixin, ExecutorShutdownTest):
...
@@ -154,7 +154,7 @@ class ThreadPoolShutdownTest(ThreadPoolMixin, ExecutorShutdownTest):
t
.
join
()
t
.
join
()
class
ProcessPoolShutdownTest
(
ProcessPoolMixin
,
ExecutorShutdownTest
):
class
ProcessPoolShutdownTest
(
ProcessPoolMixin
,
ExecutorShutdownTest
,
unittest
.
TestCase
):
def
_prime_executor
(
self
):
def
_prime_executor
(
self
):
pass
pass
...
@@ -190,7 +190,7 @@ class ProcessPoolShutdownTest(ProcessPoolMixin, ExecutorShutdownTest):
...
@@ -190,7 +190,7 @@ class ProcessPoolShutdownTest(ProcessPoolMixin, ExecutorShutdownTest):
p
.
join
()
p
.
join
()
class
WaitTests
(
unittest
.
TestCase
)
:
class
WaitTests
:
def
test_first_completed
(
self
):
def
test_first_completed
(
self
):
future1
=
self
.
executor
.
submit
(
mul
,
21
,
2
)
future1
=
self
.
executor
.
submit
(
mul
,
21
,
2
)
...
@@ -291,7 +291,7 @@ class WaitTests(unittest.TestCase):
...
@@ -291,7 +291,7 @@ class WaitTests(unittest.TestCase):
self
.
assertEqual
(
set
([
future2
]),
pending
)
self
.
assertEqual
(
set
([
future2
]),
pending
)
class
ThreadPoolWaitTests
(
ThreadPoolMixin
,
WaitTests
):
class
ThreadPoolWaitTests
(
ThreadPoolMixin
,
WaitTests
,
unittest
.
TestCase
):
def
test_pending_calls_race
(
self
):
def
test_pending_calls_race
(
self
):
# Issue #14406: multi-threaded race condition when waiting on all
# Issue #14406: multi-threaded race condition when waiting on all
...
@@ -309,11 +309,11 @@ class ThreadPoolWaitTests(ThreadPoolMixin, WaitTests):
...
@@ -309,11 +309,11 @@ class ThreadPoolWaitTests(ThreadPoolMixin, WaitTests):
sys
.
setswitchinterval
(
oldswitchinterval
)
sys
.
setswitchinterval
(
oldswitchinterval
)
class
ProcessPoolWaitTests
(
ProcessPoolMixin
,
WaitTests
):
class
ProcessPoolWaitTests
(
ProcessPoolMixin
,
WaitTests
,
unittest
.
TestCase
):
pass
pass
class
AsCompletedTests
(
unittest
.
TestCase
)
:
class
AsCompletedTests
:
# TODO(brian@sweetapp.com): Should have a test with a non-zero timeout.
# TODO(brian@sweetapp.com): Should have a test with a non-zero timeout.
def
test_no_timeout
(
self
):
def
test_no_timeout
(
self
):
future1
=
self
.
executor
.
submit
(
mul
,
2
,
21
)
future1
=
self
.
executor
.
submit
(
mul
,
2
,
21
)
...
@@ -351,15 +351,15 @@ class AsCompletedTests(unittest.TestCase):
...
@@ -351,15 +351,15 @@ class AsCompletedTests(unittest.TestCase):
completed_futures
)
completed_futures
)
class
ThreadPoolAsCompletedTests
(
ThreadPoolMixin
,
AsCompletedTests
):
class
ThreadPoolAsCompletedTests
(
ThreadPoolMixin
,
AsCompletedTests
,
unittest
.
TestCase
):
pass
pass
class
ProcessPoolAsCompletedTests
(
ProcessPoolMixin
,
AsCompletedTests
):
class
ProcessPoolAsCompletedTests
(
ProcessPoolMixin
,
AsCompletedTests
,
unittest
.
TestCase
):
pass
pass
class
ExecutorTest
(
unittest
.
TestCase
)
:
class
ExecutorTest
:
# Executor.shutdown() and context manager usage is tested by
# Executor.shutdown() and context manager usage is tested by
# ExecutorShutdownTest.
# ExecutorShutdownTest.
def
test_submit
(
self
):
def
test_submit
(
self
):
...
@@ -419,7 +419,7 @@ class ExecutorTest(unittest.TestCase):
...
@@ -419,7 +419,7 @@ class ExecutorTest(unittest.TestCase):
"Stale reference not collected within timeout."
)
"Stale reference not collected within timeout."
)
class
ThreadPoolExecutorTest
(
ThreadPoolMixin
,
ExecutorTest
):
class
ThreadPoolExecutorTest
(
ThreadPoolMixin
,
ExecutorTest
,
unittest
.
TestCase
):
def
test_map_submits_without_iteration
(
self
):
def
test_map_submits_without_iteration
(
self
):
"""Tests verifying issue 11777."""
"""Tests verifying issue 11777."""
finished
=
[]
finished
=
[]
...
@@ -431,7 +431,7 @@ class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest):
...
@@ -431,7 +431,7 @@ class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest):
self
.
assertCountEqual
(
finished
,
range
(
10
))
self
.
assertCountEqual
(
finished
,
range
(
10
))
class
ProcessPoolExecutorTest
(
ProcessPoolMixin
,
ExecutorTest
):
class
ProcessPoolExecutorTest
(
ProcessPoolMixin
,
ExecutorTest
,
unittest
.
TestCase
):
def
test_killed_child
(
self
):
def
test_killed_child
(
self
):
# When a child process is abruptly terminated, the whole pool gets
# When a child process is abruptly terminated, the whole pool gets
# "broken".
# "broken".
...
@@ -670,16 +670,7 @@ class FutureTests(unittest.TestCase):
...
@@ -670,16 +670,7 @@ class FutureTests(unittest.TestCase):
@
test
.
support
.
reap_threads
@
test
.
support
.
reap_threads
def
test_main
():
def
test_main
():
try
:
try
:
test
.
support
.
run_unittest
(
ProcessPoolExecutorTest
,
test
.
support
.
run_unittest
(
__name__
)
ThreadPoolExecutorTest
,
ProcessPoolWaitTests
,
ThreadPoolWaitTests
,
ProcessPoolAsCompletedTests
,
ThreadPoolAsCompletedTests
,
FutureTests
,
ProcessPoolShutdownTest
,
ThreadPoolShutdownTest
,
)
finally
:
finally
:
test
.
support
.
reap_children
()
test
.
support
.
reap_children
()
...
...
Misc/NEWS
View file @
355dda8d
...
@@ -116,6 +116,8 @@ Library
...
@@ -116,6 +116,8 @@ Library
Tests
Tests
-----
-----
- Issue #14407: Fix unittest test discovery in test_concurrent_futures.
- Issue #18919: Unified and extended tests for audio modules: aifc, sunau and
- Issue #18919: Unified and extended tests for audio modules: aifc, sunau and
wave.
wave.
...
...
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