Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
6bf43e23
Commit
6bf43e23
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Kill in a try finally clause
parent
4fd3df8d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
run_tests.py
+12
-12
12 additions, 12 deletions
run_tests.py
src/cutecoin/tests/process_cfg_community/test_add_community.py
+2
-2
2 additions, 2 deletions
...utecoin/tests/process_cfg_community/test_add_community.py
with
14 additions
and
14 deletions
run_tests.py
+
12
−
12
View file @
6bf43e23
...
@@ -13,18 +13,18 @@ time.sleep(2)
...
@@ -13,18 +13,18 @@ time.sleep(2)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
lib
'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
lib
'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
src
'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
src
'
)))
print
(
"
Run
"
)
runner
=
unittest
.
TextTestRunner
().
run
(
unittest
.
defaultTestLoader
.
discover
(
start_dir
=
'
cutecoin.tests
'
,
pattern
=
'
test_*
'
))
print
(
"
Terminate
"
)
os
.
kill
(
p
.
pid
,
signal
.
SIGINT
)
time
.
sleep
(
2
)
try
:
try
:
os
.
kill
(
p
.
pid
,
signal
.
SIGKILL
)
print
(
"
Run
"
)
p
.
kill
()
runner
=
unittest
.
TextTestRunner
().
run
(
unittest
.
defaultTestLoader
.
discover
(
start_dir
=
'
cutecoin.tests
'
,
pattern
=
'
test_*
'
))
print
(
"
Hard killed
"
)
finally
:
except
OSError
:
print
(
"
Terminate
"
)
print
(
"
Terminated gracefully
"
)
os
.
kill
(
p
.
pid
,
signal
.
SIGINT
)
time
.
sleep
(
2
)
try
:
os
.
kill
(
p
.
pid
,
signal
.
SIGKILL
)
p
.
kill
()
print
(
"
Hard killed
"
)
except
OSError
:
print
(
"
Terminated gracefully
"
)
sys
.
exit
(
not
runner
.
wasSuccessful
())
sys
.
exit
(
not
runner
.
wasSuccessful
())
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/cutecoin/tests/process_cfg_community/test_add_community.py
+
2
−
2
View file @
6bf43e23
...
@@ -62,7 +62,7 @@ class ProcessAddCommunity(unittest.TestCase):
...
@@ -62,7 +62,7 @@ class ProcessAddCommunity(unittest.TestCase):
process_community
.
spinbox_port
.
setValue
(
50000
)
process_community
.
spinbox_port
.
setValue
(
50000
)
self
.
assertEqual
(
process_community
.
stacked_pages
.
currentWidget
(),
self
.
assertEqual
(
process_community
.
stacked_pages
.
currentWidget
(),
process_community
.
page_node
,
process_community
.
page_node
,
msg
=
"
Current widget : {0}
"
.
format
(
process_community
.
stacked_pages
.
currentWidget
().
n
ame
()))
msg
=
"
Current widget : {0}
"
.
format
(
process_community
.
stacked_pages
.
currentWidget
().
objectN
ame
()))
self
.
assertEqual
(
process_community
.
lineedit_server
.
text
(),
"
127.0.0.1
"
)
self
.
assertEqual
(
process_community
.
lineedit_server
.
text
(),
"
127.0.0.1
"
)
self
.
assertEqual
(
process_community
.
spinbox_port
.
value
(),
50000
)
self
.
assertEqual
(
process_community
.
spinbox_port
.
value
(),
50000
)
QTest
.
mouseClick
(
process_community
.
button_register
,
Qt
.
LeftButton
)
QTest
.
mouseClick
(
process_community
.
button_register
,
Qt
.
LeftButton
)
...
@@ -84,7 +84,7 @@ class ProcessAddCommunity(unittest.TestCase):
...
@@ -84,7 +84,7 @@ class ProcessAddCommunity(unittest.TestCase):
self
.
assertEqual
(
process_community
.
stacked_pages
.
currentWidget
(),
self
.
assertEqual
(
process_community
.
stacked_pages
.
currentWidget
(),
process_community
.
page_add_nodes
,
process_community
.
page_add_nodes
,
msg
=
"
Current widget : {0}
"
.
format
(
process_community
.
stacked_pages
.
currentWidget
().
n
ame
()))
msg
=
"
Current widget : {0}
"
.
format
(
process_community
.
stacked_pages
.
currentWidget
().
objectN
ame
()))
QTest
.
mouseClick
(
process_community
.
button_next
,
Qt
.
LeftButton
)
QTest
.
mouseClick
(
process_community
.
button_next
,
Qt
.
LeftButton
)
asyncio
.
async
(
exec_test
())
asyncio
.
async
(
exec_test
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment