Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nltk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
nltk
Commits
0150e624
Commit
0150e624
authored
Apr 21, 2014
by
Steven Bird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move run_doctests utility to top-level tools directory
parent
dcd225fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
26 deletions
+16
-26
nltk/tbl/_run_doctests.py
+0
-26
tools/run_doctests.py
+16
-0
No files found.
nltk/tbl/_run_doctests.py
deleted
100755 → 0
View file @
dcd225fa
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
run the doctests in nltk.tag.tbl
"""
from
__future__
import
print_function
import
glob
,
sys
,
subprocess
,
os
.
path
from
os.path
import
abspath
currdir
=
os
.
getcwd
()
if
not
currdir
.
endswith
(
"nltk/tbl"
):
raise
RuntimeError
(
"run me in /<PATH/TO/NLTK>/nltk/tbl/"
)
sys
.
path
.
insert
(
0
,
"../../.."
)
#a list of all the python files in this dir and two levels of subdirs
files
=
[
pyfile
for
patt
in
(
"*.py"
,
"*/*.py"
,
"*/*/*.py"
)
for
pyfile
in
glob
.
glob
(
patt
)
if
not
abspath
(
__file__
)
==
abspath
(
pyfile
)]
for
pyver
in
[
"python2.6"
,
"python2.7"
,
"python3.2"
,
"python3.3"
]:
for
(
i
,
f
)
in
enumerate
(
files
,
1
):
print
(
pyver
,
i
,
f
,
file
=
sys
.
stderr
)
subprocess
.
call
([
pyver
,
"-m"
,
"doctest"
,
f
])
tools/run_doctests.py
0 → 100755
View file @
0150e624
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
run doctests
"""
from
__future__
import
print_function
import
sys
,
subprocess
,
os
for
root
,
dirs
,
filenames
in
os
.
walk
(
'.'
):
for
filename
in
filenames
:
if
filename
.
endswith
(
'.py'
):
path
=
os
.
path
.
join
(
root
,
filename
)
for
pyver
in
[
"python2.6"
,
"python2.7"
,
"python3.2"
]:
print
(
pyver
,
filename
,
file
=
sys
.
stderr
)
subprocess
.
call
([
pyver
,
"-m"
,
"doctest"
,
path
])
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