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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
ad1fe32e
Commit
ad1fe32e
authored
May 04, 2018
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error messages.
parent
97d42bce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
Cython/Build/Tests/TestCyCache.py
Cython/Build/Tests/TestCyCache.py
+9
-5
No files found.
Cython/Build/Tests/TestCyCache.py
View file @
ad1fe32e
import
difflib
import
glob
import
gzip
import
os
...
...
@@ -5,11 +6,10 @@ import tempfile
import
Cython.Build.Dependencies
import
Cython.Utils
#from Cython.Build.Dependencies import cythonize
from
Cython.TestUtils
import
CythonTest
class
Test
Inlin
e
(
CythonTest
):
class
Test
CyCach
e
(
CythonTest
):
def
setUp
(
self
):
CythonTest
.
setUp
(
self
)
...
...
@@ -43,14 +43,17 @@ class TestInline(CythonTest):
self
.
fresh_cythonize
(
a_pyx
,
cache
=
self
.
cache_dir
)
a_contents2
=
open
(
a_c
).
read
()
self
.
assertNotEqual
(
a_contents1
,
a_contents2
)
self
.
assertNotEqual
(
a_contents1
,
a_contents2
,
'C file not changed!'
)
self
.
assertEqual
(
2
,
len
(
self
.
cache_files
(
'a.c*'
)))
open
(
a_pyx
,
'w'
).
write
(
content1
)
self
.
fresh_cythonize
(
a_pyx
,
cache
=
self
.
cache_dir
)
self
.
assertEqual
(
2
,
len
(
self
.
cache_files
(
'a.c*'
)))
a_contents
=
open
(
a_c
).
read
()
self
.
assertEqual
(
a_contents
,
a_contents1
)
self
.
assertEqual
(
a_contents
,
a_contents1
,
msg
=
'
\
n
'
.
join
(
list
(
difflib
.
unified_diff
(
a_contents
.
split
(
'
\
n
'
),
a_contents1
.
split
(
'
\
n
'
)))[:
10
]))
def
test_cycache_uses_cache
(
self
):
a_pyx
=
os
.
path
.
join
(
self
.
src_dir
,
'a.pyx'
)
...
...
@@ -62,7 +65,8 @@ class TestInline(CythonTest):
os
.
unlink
(
a_c
)
self
.
fresh_cythonize
(
a_pyx
,
cache
=
self
.
cache_dir
)
a_contents
=
open
(
a_c
).
read
()
self
.
assertEqual
(
a_contents
,
'fake stuff'
)
self
.
assertEqual
(
a_contents
,
'fake stuff'
,
'Unexpected contents: %s...'
%
a_contents
[:
100
])
def
test_multi_file_output
(
self
):
a_pyx
=
os
.
path
.
join
(
self
.
src_dir
,
'a.pyx'
)
...
...
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