diff options
Diffstat (limited to 'tests/test_cli.py')
| -rw-r--r-- | tests/test_cli.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/test_cli.py b/tests/test_cli.py index 5f1ea0e..746b632 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - import subprocess import sys @@ -71,7 +69,7 @@ def test_stdout(filepath, load_file, capsys): def test_script(): # Call with the --help option as a basic sanity check. - cmd = "{0:s} -m sqlparse.cli --help".format(sys.executable) + cmd = "{:s} -m sqlparse.cli --help".format(sys.executable) assert subprocess.call(cmd.split()) == 0 @@ -115,7 +113,7 @@ def test_encoding_stdin_utf8(filepath, load_file, capfd): path = filepath('encoding_utf8.sql') expected = load_file('encoding_utf8.sql', 'utf-8') old_stdin = sys.stdin - with open(path, 'r') as f: + with open(path) as f: sys.stdin = f sys.stdout.encoding = 'utf-8' sqlparse.cli.main(['-']) @@ -128,7 +126,7 @@ def test_encoding_stdin_gbk(filepath, load_file, capfd): path = filepath('encoding_gbk.sql') expected = load_file('encoding_gbk.sql', 'gbk') old_stdin = sys.stdin - with open(path, 'r') as stream: + with open(path) as stream: sys.stdin = stream sys.stdout.encoding = 'gbk' sqlparse.cli.main(['-', '--encoding', 'gbk']) @@ -139,7 +137,7 @@ def test_encoding_stdin_gbk(filepath, load_file, capfd): def test_encoding(filepath, capsys): path = filepath('test_cp1251.sql') - expected = u'insert into foo values (1); -- Песня про надежду\n' + expected = 'insert into foo values (1); -- Песня про надежду\n' sqlparse.cli.main([path, '--encoding=cp1251']) out, _ = capsys.readouterr() assert out == expected |
