Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: third_party/cython/src/pyximport/test/test_reload.py

Issue 385073004: Adding cython v0.20.2 in third-party. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reference cython dev list thread. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # reload seems to work for Python 2.3 but not 2.2.
2 import time, os, sys
3 import test_pyximport
4
5 # debugging the 2.2 problem
6 if 1:
7 from distutils import sysconfig
8 try:
9 sysconfig.set_python_build()
10 except AttributeError:
11 pass
12 import pyxbuild
13 print pyxbuild.distutils.sysconfig == sysconfig
14
15 def test():
16 tempdir = test_pyximport.make_tempdir()
17 sys.path.append(tempdir)
18 hello_file = os.path.join(tempdir, "hello.pyx")
19 open(hello_file, "w").write("x = 1; print x; before = 'before'\n")
20 import hello
21 assert hello.x == 1
22
23 time.sleep(1) # sleep to make sure that new "hello.pyx" has later
24 # timestamp than object file.
25
26 open(hello_file, "w").write("x = 2; print x; after = 'after'\n")
27 reload(hello)
28 assert hello.x == 2, "Reload should work on Python 2.3 but not 2.2"
29 test_pyximport.remove_tempdir(tempdir)
30
31 if __name__=="__main__":
32 test()
33
OLDNEW
« no previous file with comments | « third_party/cython/src/pyximport/test/test_pyximport.py ('k') | third_party/cython/src/runtests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698