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
Gwenaël Samain
cython
Commits
c7737883
Commit
c7737883
authored
Jul 26, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make unit test runner only scan Cython/ (it was failing after doing a setup.py build)
parent
c7db17a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
runtests.py
runtests.py
+5
-3
No files found.
runtests.py
View file @
c7737883
...
@@ -286,7 +286,7 @@ class CythonUnitTestCase(CythonCompileTestCase):
...
@@ -286,7 +286,7 @@ class CythonUnitTestCase(CythonCompileTestCase):
except
Exception
:
except
Exception
:
pass
pass
def
collect_unittests
(
path
,
suite
,
selectors
):
def
collect_unittests
(
path
,
module_prefix
,
suite
,
selectors
):
def
file_matches
(
filename
):
def
file_matches
(
filename
):
return
filename
.
startswith
(
"Test"
)
and
filename
.
endswith
(
".py"
)
return
filename
.
startswith
(
"Test"
)
and
filename
.
endswith
(
".py"
)
...
@@ -301,7 +301,7 @@ def collect_unittests(path, suite, selectors):
...
@@ -301,7 +301,7 @@ def collect_unittests(path, suite, selectors):
for
f
in
filenames
:
for
f
in
filenames
:
if
file_matches
(
f
):
if
file_matches
(
f
):
filepath
=
os
.
path
.
join
(
dirpath
,
f
)[:
-
len
(
".py"
)]
filepath
=
os
.
path
.
join
(
dirpath
,
f
)[:
-
len
(
".py"
)]
modulename
=
filepath
[
len
(
path
)
+
1
:].
replace
(
os
.
path
.
sep
,
'.'
)
modulename
=
module_prefix
+
filepath
[
len
(
path
)
+
1
:].
replace
(
os
.
path
.
sep
,
'.'
)
if
not
[
1
for
match
in
selectors
if
match
(
modulename
)
]:
if
not
[
1
for
match
in
selectors
if
match
(
modulename
)
]:
continue
continue
module
=
__import__
(
modulename
)
module
=
__import__
(
modulename
)
...
@@ -360,6 +360,8 @@ if __name__ == '__main__':
...
@@ -360,6 +360,8 @@ if __name__ == '__main__':
# RUN ALL TESTS!
# RUN ALL TESTS!
ROOTDIR
=
os
.
path
.
join
(
os
.
getcwd
(),
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
'tests'
)
ROOTDIR
=
os
.
path
.
join
(
os
.
getcwd
(),
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
'tests'
)
WORKDIR
=
os
.
path
.
join
(
os
.
getcwd
(),
'BUILD'
)
WORKDIR
=
os
.
path
.
join
(
os
.
getcwd
(),
'BUILD'
)
UNITTEST_MODULE
=
"Cython"
UNITTEST_ROOT
=
os
.
path
.
join
(
os
.
getcwd
(),
UNITTEST_MODULE
)
if
WITH_CYTHON
:
if
WITH_CYTHON
:
if
os
.
path
.
exists
(
WORKDIR
):
if
os
.
path
.
exists
(
WORKDIR
):
shutil
.
rmtree
(
WORKDIR
,
ignore_errors
=
True
)
shutil
.
rmtree
(
WORKDIR
,
ignore_errors
=
True
)
...
@@ -382,7 +384,7 @@ if __name__ == '__main__':
...
@@ -382,7 +384,7 @@ if __name__ == '__main__':
test_suite
=
unittest
.
TestSuite
()
test_suite
=
unittest
.
TestSuite
()
if
options
.
unittests
:
if
options
.
unittests
:
collect_unittests
(
os
.
getcwd
()
,
test_suite
,
selectors
)
collect_unittests
(
UNITTEST_ROOT
,
UNITTEST_MODULE
+
"."
,
test_suite
,
selectors
)
if
options
.
filetests
:
if
options
.
filetests
:
filetests
=
TestBuilder
(
ROOTDIR
,
WORKDIR
,
selectors
,
filetests
=
TestBuilder
(
ROOTDIR
,
WORKDIR
,
selectors
,
...
...
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