Get rid of a cwd to tmpdir, because with the subprocess it doesn't behave the same depending on which tests you run first

This commit is contained in:
Dave Halter
2018-01-20 21:56:56 +01:00
parent d3a5025635
commit fc315108f0

View File

@@ -65,10 +65,10 @@ def test_complete_at_zero(Script):
assert len(s) > 0
def test_wrong_encoding(Script, cwd_tmpdir):
x = cwd_tmpdir.join('x.py')
def test_wrong_encoding(Script, tmpdir):
x = tmpdir.join('x.py')
# Use both latin-1 and utf-8 (a really broken file).
x.write_binary(u'foobar = 1\nä'.encode('latin-1') + u'ä'.encode('utf-8'))
c, = Script('import x; x.foo', sys_path=['.']).completions()
c, = Script('import x; x.foo', sys_path=[tmpdir.strpath]).completions()
assert c.name == 'foobar'