[py-svn] r7918 - py/dist/py/code

hpk at codespeak.net hpk at codespeak.net
Sat Dec 18 15:30:31 CET 2004


Author: hpk
Date: Sat Dec 18 15:30:30 2004
New Revision: 7918

Added:
   py/dist/py/code/test_cpython_features.py
Log:
some features explicitely tested for that might
change during python versions ... 



Added: py/dist/py/code/test_cpython_features.py
==============================================================================
--- (empty file)
+++ py/dist/py/code/test_cpython_features.py	Sat Dec 18 15:30:30 2004
@@ -0,0 +1,16 @@
+
+import new 
+
+def test_compile_passes_on_filename(): 
+    class mystr(str): 
+        pass 
+    filename = mystr("dummy")
+    co = compile("hello\n", filename, 'exec')
+    assert not isinstance(co.co_filename, mystr) 
+    c2 = new.code(co.co_argcount, co.co_nlocals, co.co_stacksize, 
+             co.co_flags, co.co_code, co.co_consts, 
+             co.co_names, co.co_varnames, 
+             filename, 
+             co.co_name, co.co_firstlineno, co.co_lnotab, 
+             co.co_freevars, co.co_cellvars)
+    assert c2.co_filename is filename 



More information about the pytest-commit mailing list