Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
d0c61cc7
Commit
d0c61cc7
authored
Sep 25, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7750707f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
4 deletions
+29
-4
go/neo/t/nxd/nxdtest
go/neo/t/nxd/nxdtest
+29
-4
No files found.
go/neo/t/nxd/nxdtest
View file @
d0c61cc7
...
@@ -35,7 +35,8 @@ import six
...
@@ -35,7 +35,8 @@ import six
# loadNXDTestFile loads .nxdtest file located @path.
# loadNXDTestFile loads .nxdtest file located @path.
def
loadNXDTestFile
(
path
):
# -> TestEnv
def
loadNXDTestFile
(
path
):
# -> TestEnv
t
=
TestEnv
()
t
=
TestEnv
()
g
=
{
'TestCase'
:
t
.
TestCase
}
# TODO + all other public TestEnv methods
g
=
{
'TestCase'
:
t
.
TestCase
,
# TODO + all other public TestEnv methods
'PyTest'
:
PyTest
}
with
open
(
path
,
"r"
)
as
f
:
with
open
(
path
,
"r"
)
as
f
:
src
=
f
.
read
()
src
=
f
.
read
()
six
.
exec_
(
src
,
g
)
six
.
exec_
(
src
,
g
)
...
@@ -238,9 +239,33 @@ class LocalTestResultLine:
...
@@ -238,9 +239,33 @@ class LocalTestResultLine:
# XXX + dump .json ?
# XXX + dump .json ?
# well-known summary functions
# support for well-known summary functions
def
pytest_summary
(
out
):
# -> status_dict
class
PyTest
:
# XXX
@
staticmethod
def
summary
(
out
):
# -> status_dict
# last line is like
# ================ 1 failed, 1 passed, 12 skipped in 0.39 seconds ================
textv
=
out
.
splitlines
()
tail
=
textv
[
-
1
]
def
get
(
name
,
default
=
None
):
m
=
re
.
search
(
r'\b([0-9]+) '
+
name
+
r'\b'
,
tail
)
if
m
is
None
:
return
default
return
int
(
m
.
group
(
1
))
stat
=
{}
def
set_stat
(
stat_key
,
from_name
):
v
=
get
(
from_name
)
if
v
is
None
:
return
stat
[
stat_key
]
=
v
set_stat
(
'skip_count'
,
'skipped'
)
set_stat
(
'error_count'
,
'failed'
)
# XXX failure_count <- ?
nxfail
=
get
(
'xfailed'
,
0
)
npass
=
get
(
'passed'
,
0
)
stat
[
'test_count'
]
=
npass
+
nxfail
+
stat
.
get
(
'skip_count'
,
0
)
+
stat
.
get
(
'error_count'
,
0
)
return
stat
def
unittest_summary
(
out
):
# -> status_dict
def
unittest_summary
(
out
):
# -> status_dict
# XXX -> erp5.util.testsuite.EggTestSuite
# XXX -> erp5.util.testsuite.EggTestSuite
...
...
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