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
4f3f0c5d
Commit
4f3f0c5d
authored
Apr 06, 2014
by
Martín Gaitán
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag ipython testcase to skip them is ipython is not available
parent
4cbff596
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
Cython/Build/Tests/TestIpythonMagic.py
Cython/Build/Tests/TestIpythonMagic.py
+2
-0
runtests.py
runtests.py
+8
-7
No files found.
Cython/Build/Tests/TestIpythonMagic.py
View file @
4f3f0c5d
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# tag: ipython
"""Tests for the Cython magics extension."""
"""Tests for the Cython magics extension."""
import
os
import
os
...
...
runtests.py
View file @
4f3f0c5d
...
@@ -95,6 +95,7 @@ EXT_DEP_MODULES = {
...
@@ -95,6 +95,7 @@ EXT_DEP_MODULES = {
'tag:pstats'
:
'pstats'
,
'tag:pstats'
:
'pstats'
,
'tag:posix'
:
'posix'
,
'tag:posix'
:
'posix'
,
'tag:array'
:
'array'
,
'tag:array'
:
'array'
,
'tag:ipython'
:
'IPython'
}
}
def
patch_inspect_isfunction
():
def
patch_inspect_isfunction
():
...
@@ -481,7 +482,7 @@ class TestBuilder(object):
...
@@ -481,7 +482,7 @@ class TestBuilder(object):
if match(fqmodule, tags) ]:
if match(fqmodule, tags) ]:
continue
continue
if self.exclude_selectors:
if self.exclude_selectors:
if [1 for match in self.exclude_selectors
if [1 for match in self.exclude_selectors
if match(fqmodule, tags)]:
if match(fqmodule, tags)]:
continue
continue
...
@@ -515,7 +516,7 @@ class TestBuilder(object):
...
@@ -515,7 +516,7 @@ class TestBuilder(object):
if mode == 'run' and ext == '.py' and not self.cython_only:
if mode == 'run' and ext == '.py' and not self.cython_only:
# additionally test file in real Python
# additionally test file in real Python
suite.addTest(PureDoctestTestCase(module, os.path.join(path, filename)))
suite.addTest(PureDoctestTestCase(module, os.path.join(path, filename)))
return suite
return suite
def build_tests(self, test_class, path, workdir, module, expect_errors, tags):
def build_tests(self, test_class, path, workdir, module, expect_errors, tags):
...
@@ -1404,7 +1405,7 @@ class TagsSelector:
...
@@ -1404,7 +1405,7 @@ class TagsSelector:
def __init__(self, tag, value):
def __init__(self, tag, value):
self.tag = tag
self.tag = tag
self.value = value
self.value = value
def __call__(self, testname, tags=None):
def __call__(self, testname, tags=None):
if tags is None:
if tags is None:
return False
return False
...
@@ -1412,7 +1413,7 @@ class TagsSelector:
...
@@ -1412,7 +1413,7 @@ class TagsSelector:
return self.value in tags[self.tag]
return self.value in tags[self.tag]
class RegExSelector:
class RegExSelector:
def __init__(self, pattern_string):
def __init__(self, pattern_string):
try:
try:
self.pattern = re.compile(pattern_string, re.I|re.U)
self.pattern = re.compile(pattern_string, re.I|re.U)
...
@@ -1440,7 +1441,7 @@ class ShardExcludeSelector:
...
@@ -1440,7 +1441,7 @@ class ShardExcludeSelector:
def __call__(self, testname, tags=None):
def __call__(self, testname, tags=None):
return abs(hash(testname)) % self.shard_count != self.shard_num
return abs(hash(testname)) % self.shard_count != self.shard_num
def refactor_for_py3(distdir, cy3_dir):
def refactor_for_py3(distdir, cy3_dir):
# need to convert Cython sources first
# need to convert Cython sources first
...
@@ -1645,7 +1646,7 @@ def main():
...
@@ -1645,7 +1646,7 @@ def main():
options, cmd_args = parser.parse_args()
options, cmd_args = parser.parse_args()
WORKDIR = os.path.abspath(options.work_dir)
WORKDIR = os.path.abspath(options.work_dir)
if sys.version_info[0] >= 3:
if sys.version_info[0] >= 3:
options.doctests = False
options.doctests = False
if options.with_cython:
if options.with_cython:
...
@@ -1744,7 +1745,7 @@ def runtests(options, cmd_args, coverage=None):
...
@@ -1744,7 +1745,7 @@ def runtests(options, cmd_args, coverage=None):
if
options
.
shard_num
>
-
1
:
if
options
.
shard_num
>
-
1
:
WORKDIR
=
os
.
path
.
join
(
WORKDIR
,
str
(
options
.
shard_num
))
WORKDIR
=
os
.
path
.
join
(
WORKDIR
,
str
(
options
.
shard_num
))
# RUN ALL TESTS!
# RUN ALL TESTS!
UNITTEST_MODULE
=
"Cython"
UNITTEST_MODULE
=
"Cython"
UNITTEST_ROOT
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
UNITTEST_MODULE
)
UNITTEST_ROOT
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
UNITTEST_MODULE
)
...
...
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