test that python loads our fake pycs

This commit is contained in:
Benjamin Peterson 2011-05-24 17:52:17 -05:00
parent 7fc2f8786f
commit f5decc90ca
1 changed files with 7 additions and 0 deletions

View File

@ -221,3 +221,10 @@ def test_warn_missing(testdir):
result.stderr.fnmatch_lines([ result.stderr.fnmatch_lines([
"*WARNING*assertion*", "*WARNING*assertion*",
]) ])
def test_load_fake_pyc(testdir):
path = testdir.makepyfile("x = 'hello'")
co = compile("x = 'bye'", str(path), "exec")
plugin._write_pyc(co, path)
mod = path.pyimport()
assert mod.x == "bye"