168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 | |
def test_get_encoding_for_real(): |
-> temp = py.test.ensuretemp('test_get_encoding') |
fpath = temp.join('utf-8.py') |
fpath.write(str(py.code.Source("""\ |
#!/usr/bin/env python |
# -*- coding: UTF-8 -*- |
|
def foo(): |
return 'föö' |
"""))) |
assert get_module_encoding(fpath.strpath) == 'UTF-8' | |