Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
badw-it
DHParser
Commits
4fdd3078
Commit
4fdd3078
authored
Apr 11, 2019
by
di68kap
Browse files
- testing.py: Show notice of testing artifacts in AST tree structure in test report!
parent
b8925e22
Changes
1
Hide whitespace changes
Inline
Side-by-side
DHParser/testing.py
View file @
4fdd3078
...
...
@@ -358,11 +358,15 @@ def grammar_unit(test_unit, parser_factory, transformer_factory, report=True, ve
or
(
len
(
raw_errors
)
==
1
and
raw_errors
[
-
1
].
code
==
Error
.
MANDATORY_CONTINUATION_AT_EOF
))
if
is_artifact
:
# remove zombie node with error message at the end
# don't remove zombie node with error message at the end
# but change it's tag_name to indicate that it is an artifact!
for
parent
in
st
.
select
(
lambda
node
:
any
(
child
.
tag_name
==
ZOMBIE_TAG
for
child
in
node
.
children
),
include_root
=
True
,
reverse
=
True
):
parent
.
result
=
tuple
(
c
for
c
in
parent
.
children
if
c
.
tag_name
!=
ZOMBIE_TAG
)
zombie
=
parent
[
ZOMBIE_TAG
]
zombie
.
tag_name
=
'__TESTING_ARTIFACT__'
zombie
.
result
=
'Artifact can be ignored, but tree structure may not be fully reliable!'
# parent.result = tuple(c for c in parent.children if c.tag_name != ZOMBIE_TAG)
break
return
is_artifact
...
...
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