Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
bcec0132
Commit
bcec0132
authored
Jan 03, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make test runner bark at unknown tag names in test files
parent
c994f01b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
runtests.py
runtests.py
+19
-6
No files found.
runtests.py
View file @
bcec0132
...
...
@@ -299,20 +299,33 @@ def memoize(f):
@memoize
def parse_tags(filepath):
tags = defaultdict(list)
parse_tag = re.compile(r'#
\
s*(
\
w+)
\
s*:(.*)$
'
).match
f = io_open(filepath, encoding='ISO-8859-1', errors='ignore')
try:
for line in f:
# ignore BOM-like bytes and whitespace
line = line.lstrip(UTF8_BOM_BYTES).strip()
if not line:
continue
if tags:
break # assume all tags are in one block
else:
continue
if line[0] != '#':
break
ix = line.find(':')
if ix != -1:
tag = line[1:ix].strip()
values = line[ix+1:].split(',')
tags[tag].extend([value.strip() for value in values])
parsed = parse_tag(line)
if parsed:
tag, values = parsed.groups()
if tag in ('coding', 'encoding'):
continue
if tag == 'tags':
tag = 'tag'
print("
WARNING
:
test
tags
use
the
'tag'
directive
,
not
'tags'
(
%
s
)
" % filepath)
if tag not in ('mode', 'tag', 'ticket', 'cython'):
print("
WARNING
:
unknown
test
directive
'%s'
found
(
%
s
)
" % (tag, filepath))
values = values.split(',')
tags[tag].extend(filter(None, [value.strip() for value in values]))
elif tags:
break # assume all tags are in one block
finally:
f.close()
return tags
...
...
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