Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
7e01c5be
Commit
7e01c5be
authored
Nov 12, 2017
by
Alex Willmer
Committed by
David Wilson
Mar 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import and use unittest2 without aliasing it
parent
e8e023ce
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
41 additions
and
41 deletions
+41
-41
tests/call_function_test.py
tests/call_function_test.py
+2
-2
tests/channel_test.py
tests/channel_test.py
+2
-2
tests/fakessh_test.py
tests/fakessh_test.py
+3
-3
tests/first_stage_test.py
tests/first_stage_test.py
+2
-2
tests/id_allocation_test.py
tests/id_allocation_test.py
+2
-2
tests/importer_test.py
tests/importer_test.py
+2
-2
tests/local_test.py
tests/local_test.py
+3
-3
tests/master_test.py
tests/master_test.py
+5
-5
tests/module_finder_test.py
tests/module_finder_test.py
+2
-2
tests/nested_test.py
tests/nested_test.py
+2
-2
tests/responder_test.py
tests/responder_test.py
+4
-4
tests/select_test.py
tests/select_test.py
+2
-2
tests/ssh_test.py
tests/ssh_test.py
+4
-4
tests/testlib.py
tests/testlib.py
+2
-2
tests/utils_test.py
tests/utils_test.py
+4
-4
No files found.
tests/call_function_test.py
View file @
7e01c5be
import
logging
import
time
import
unittest2
as
unittest
import
unittest2
import
mitogen.core
import
mitogen.master
...
...
@@ -89,4 +89,4 @@ class CallFunctionTest(testlib.RouterMixin, testlib.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/channel_test.py
View file @
7e01c5be
import
unittest2
as
unittest
import
unittest2
import
mitogen.core
import
testlib
...
...
@@ -17,4 +17,4 @@ class ConstructorTest(testlib.RouterMixin, testlib.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/fakessh_test.py
View file @
7e01c5be
...
...
@@ -2,14 +2,14 @@
import
os
import
shutil
import
unittest2
as
unittest
import
unittest2
import
mitogen.fakessh
import
testlib
class
RsyncTest
(
testlib
.
DockerMixin
,
unittest
.
TestCase
):
class
RsyncTest
(
testlib
.
DockerMixin
,
unittest
2
.
TestCase
):
def
test_rsync_from_master
(
self
):
context
=
self
.
docker_ssh_any
()
...
...
@@ -60,4 +60,4 @@ class RsyncTest(testlib.DockerMixin, unittest.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/first_stage_test.py
View file @
7e01c5be
import
subprocess
import
unittest2
as
unittest
import
unittest2
import
mitogen.master
import
testlib
...
...
@@ -40,4 +40,4 @@ class CommandLineTest(testlib.RouterMixin, testlib.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/id_allocation_test.py
View file @
7e01c5be
import
unittest2
as
unittest
import
unittest2
import
testlib
import
id_allocation
...
...
@@ -13,4 +13,4 @@ class SlaveTest(testlib.RouterMixin, testlib.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/importer_test.py
View file @
7e01c5be
...
...
@@ -6,7 +6,7 @@ import zlib
import
mock
import
pytest
import
unittest2
as
unittest
import
unittest2
import
mitogen.core
import
testlib
...
...
@@ -128,4 +128,4 @@ class EmailParseAddrSysTest(testlib.RouterMixin, testlib.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/local_test.py
View file @
7e01c5be
import
os
import
unittest2
as
unittest
import
unittest2
import
mitogen
import
mitogen.ssh
...
...
@@ -11,7 +11,7 @@ import testlib
import
plain_old_module
class
LocalTest
(
testlib
.
RouterMixin
,
unittest
.
TestCase
):
class
LocalTest
(
testlib
.
RouterMixin
,
unittest
2
.
TestCase
):
stream_class
=
mitogen
.
ssh
.
Stream
def
test_stream_name
(
self
):
...
...
@@ -21,4 +21,4 @@ class LocalTest(testlib.RouterMixin, unittest.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/master_test.py
View file @
7e01c5be
...
...
@@ -2,13 +2,13 @@
import
subprocess
import
time
import
unittest2
as
unittest
import
unittest2
import
testlib
import
mitogen.master
class
ScanCodeImportsTest
(
unittest
.
TestCase
):
class
ScanCodeImportsTest
(
unittest
2
.
TestCase
):
func
=
staticmethod
(
mitogen
.
master
.
scan_code_imports
)
def
test_simple
(
self
):
...
...
@@ -22,7 +22,7 @@ class ScanCodeImportsTest(unittest.TestCase):
])
class
IterReadTest
(
unittest
.
TestCase
):
class
IterReadTest
(
unittest
2
.
TestCase
):
func
=
staticmethod
(
mitogen
.
master
.
iter_read
)
def
make_proc
(
self
):
...
...
@@ -74,7 +74,7 @@ class IterReadTest(unittest.TestCase):
proc
.
terminate
()
class
WriteAllTest
(
unittest
.
TestCase
):
class
WriteAllTest
(
unittest
2
.
TestCase
):
func
=
staticmethod
(
mitogen
.
master
.
write_all
)
def
make_proc
(
self
):
...
...
@@ -115,4 +115,4 @@ class WriteAllTest(unittest.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/module_finder_test.py
View file @
7e01c5be
import
inspect
import
unittest2
as
unittest
import
unittest2
import
mitogen.master
...
...
@@ -146,4 +146,4 @@ class FindRelatedImportsTest(testlib.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/nested_test.py
View file @
7e01c5be
import
os
import
unittest2
as
unittest
import
unittest2
import
testlib
...
...
@@ -17,4 +17,4 @@ class NestedTest(testlib.RouterMixin, testlib.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/responder_test.py
View file @
7e01c5be
...
...
@@ -3,7 +3,7 @@ import mock
import
subprocess
import
sys
import
unittest2
as
unittest
import
unittest2
import
mitogen.master
import
testlib
...
...
@@ -12,7 +12,7 @@ import plain_old_module
import
simple_pkg.a
class
GoodModulesTest
(
testlib
.
RouterMixin
,
unittest
.
TestCase
):
class
GoodModulesTest
(
testlib
.
RouterMixin
,
unittest
2
.
TestCase
):
def
test_plain_old_module
(
self
):
# The simplest case: a top-level module with no interesting imports or
# package machinery damage.
...
...
@@ -34,7 +34,7 @@ class GoodModulesTest(testlib.RouterMixin, unittest.TestCase):
self
.
assertEquals
(
output
,
"['__main__', 50]
\
n
"
)
class
BrokenModulesTest
(
unittest
.
TestCase
):
class
BrokenModulesTest
(
unittest
2
.
TestCase
):
def
test_obviously_missing
(
self
):
# Ensure we don't crash in the case of a module legitimately being
# unavailable. Should never happen in the real world.
...
...
@@ -79,4 +79,4 @@ class BrokenModulesTest(unittest.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/select_test.py
View file @
7e01c5be
import
unittest2
as
unittest
import
unittest2
import
mitogen.master
...
...
@@ -262,4 +262,4 @@ class GetTest(testlib.RouterMixin, testlib.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/ssh_test.py
View file @
7e01c5be
...
...
@@ -2,13 +2,13 @@ import mitogen
import
mitogen.ssh
import
mitogen.utils
import
unittest2
as
unittest
import
unittest2
import
testlib
import
plain_old_module
class
FakeSshTest
(
testlib
.
RouterMixin
,
unittest
.
TestCase
):
class
FakeSshTest
(
testlib
.
RouterMixin
,
unittest
2
.
TestCase
):
def
test_okay
(
self
):
context
=
self
.
router
.
ssh
(
hostname
=
'hostname'
,
...
...
@@ -20,7 +20,7 @@ class FakeSshTest(testlib.RouterMixin, unittest.TestCase):
self
.
assertEquals
(
3
,
context
.
call
(
plain_old_module
.
add
,
1
,
2
))
class
SshTest
(
testlib
.
DockerMixin
,
unittest
.
TestCase
):
class
SshTest
(
testlib
.
DockerMixin
,
unittest
2
.
TestCase
):
stream_class
=
mitogen
.
ssh
.
Stream
def
test_stream_name
(
self
):
...
...
@@ -101,4 +101,4 @@ class SshTest(testlib.DockerMixin, unittest.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
tests/testlib.py
View file @
7e01c5be
...
...
@@ -7,7 +7,7 @@ import sys
import
time
import
urlparse
import
unittest2
as
unittest
import
unittest2
import
mitogen.master
if
mitogen
.
is_master
:
# TODO: shouldn't be necessary.
...
...
@@ -114,7 +114,7 @@ def wait_for_port(
%
(
host
,
port
))
class
TestCase
(
unittest
.
TestCase
):
class
TestCase
(
unittest
2
.
TestCase
):
def
assertRaises
(
self
,
exc
,
func
,
*
args
,
**
kwargs
):
"""Like regular assertRaises, except return the exception that was
raised. Can't use context manager because tests must run on Python2.4"""
...
...
tests/utils_test.py
View file @
7e01c5be
#!/usr/bin/env python
import
unittest2
as
unittest
import
unittest2
import
mitogen.master
import
mitogen.utils
...
...
@@ -15,7 +15,7 @@ def func(router):
return
router
class
RunWithRouterTest
(
unittest
.
TestCase
):
class
RunWithRouterTest
(
unittest
2
.
TestCase
):
# test_shutdown_on_exception
# test_shutdown_on_success
...
...
@@ -25,7 +25,7 @@ class RunWithRouterTest(unittest.TestCase):
self
.
assertFalse
(
router
.
broker
.
_thread
.
isAlive
())
class
WithRouterTest
(
unittest
.
TestCase
):
class
WithRouterTest
(
unittest
2
.
TestCase
):
def
test_with_broker
(
self
):
router
=
func
()
self
.
assertIsInstance
(
router
,
mitogen
.
master
.
Router
)
...
...
@@ -33,4 +33,4 @@ class WithRouterTest(unittest.TestCase):
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
2
.
main
()
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