@@ -11,7 +11,7 @@ def test_version(tmpdir, capsys):
11
11
"""Test that the version is correct."""
12
12
with tmpdir .as_cwd ():
13
13
with pytest .raises (SystemExit ) as exc_info :
14
- main (["relint.py" , " --version" ])
14
+ main (["--version" ])
15
15
assert "0" in str (exc_info .value )
16
16
assert f"relint: { relint .__version__ } " in capsys .readouterr ().out
17
17
@@ -24,7 +24,7 @@ def test_main_execution(self, tmpdir, fixture_dir):
24
24
tmpdir .join ("dummy.py" ).write ("# TODO do something" )
25
25
with tmpdir .as_cwd ():
26
26
with pytest .raises (SystemExit ) as exc_info :
27
- main (["relint.py" , " dummy.py" ])
27
+ main (["dummy.py" ])
28
28
29
29
assert exc_info .value .code == 0
30
30
@@ -35,7 +35,7 @@ def test_main_execution_with_error(self, capsys, tmpdir, fixture_dir):
35
35
tmpdir .join ("dummy.py" ).write ("# FIXME do something" )
36
36
with tmpdir .as_cwd ():
37
37
with pytest .raises (SystemExit ) as exc_info :
38
- main (["relint.py" , " dummy.py" ])
38
+ main (["dummy.py" ])
39
39
40
40
out , _ = capsys .readouterr ()
41
41
assert "dummy.py:1" in out
@@ -44,15 +44,15 @@ def test_main_execution_with_error(self, capsys, tmpdir, fixture_dir):
44
44
assert "❱ 1 # FIXME do something" in out
45
45
assert exc_info .value .code == 1
46
46
47
- @pytest .mark .parametrize ("args" , [tuple (), ( "--summarize" ) ])
47
+ @pytest .mark .parametrize ("args" , [[], [ "--summarize" ] ])
48
48
def test_main_execution_without_hint (self , args , capsys , tmpdir , fixture_dir ):
49
49
with (fixture_dir / ".relint.yml" ).open () as fs :
50
50
config = fs .read ()
51
51
tmpdir .join (".relint.yml" ).write (config )
52
52
tmpdir .join ("dummy.py" ).write ("# hint: 🤐" )
53
53
with tmpdir .as_cwd ():
54
54
with pytest .raises (SystemExit ):
55
- main (["relint.py" , " dummy.py" , * args ])
55
+ main (["dummy.py" , * args ])
56
56
57
57
out , _ = capsys .readouterr ()
58
58
assert "dummy.py:1" in out
@@ -65,7 +65,7 @@ def test_raise_for_warnings(self, tmpdir, fixture_dir):
65
65
tmpdir .join ("dummy.py" ).write ("# TODO do something" )
66
66
with tmpdir .as_cwd ():
67
67
with pytest .raises (SystemExit ) as exc_info :
68
- main (["relint.py" , " dummy.py" , "-W" ])
68
+ main (["dummy.py" , "-W" ])
69
69
70
70
assert exc_info .value .code == 1
71
71
@@ -76,7 +76,7 @@ def test_ignore_warnings(self, tmpdir, fixture_dir):
76
76
tmpdir .join ("dummy.py" ).write ("# TODO do something" )
77
77
with tmpdir .as_cwd ():
78
78
with pytest .raises (SystemExit ) as exc_info :
79
- main (["relint.py" , " dummy.py" , "--ignore-warnings" ])
79
+ main (["dummy.py" , "--ignore-warnings" ])
80
80
81
81
assert exc_info .value .code == 0
82
82
@@ -87,7 +87,7 @@ def test_summarize(self, tmpdir, fixture_dir, capsys):
87
87
tmpdir .join ("dummy.py" ).write ("# FIXME do something" )
88
88
with tmpdir .as_cwd ():
89
89
with pytest .raises (SystemExit ) as exc_info :
90
- main (["relint.py" , " dummy.py" , "--summarize" ])
90
+ main (["dummy.py" , "--summarize" ])
91
91
92
92
out , _ = capsys .readouterr ()
93
93
assert "dummy.py:1" in out
@@ -103,7 +103,7 @@ def test_code_padding_disabled(self, tmpdir, fixture_dir, capsys):
103
103
tmpdir .join ("dummy.py" ).write ("# FIXME do something" )
104
104
with tmpdir .as_cwd ():
105
105
with pytest .raises (SystemExit ) as exc_info :
106
- main (["relint.py" , " dummy.py" , "--code-padding=-1" ])
106
+ main (["dummy.py" , "--code-padding=-1" ])
107
107
108
108
out , _ = capsys .readouterr ()
109
109
assert "dummy.py:1" in out
@@ -126,7 +126,7 @@ def test_main_execution_with_diff(self, capsys, mocker, tmpdir, fixture_dir):
126
126
127
127
with tmpdir .as_cwd ():
128
128
with pytest .raises (SystemExit ) as exc_info :
129
- main (["relint.py" , " dummy.py" , "--diff" ])
129
+ main (["dummy.py" , "--diff" ])
130
130
131
131
out , _ = capsys .readouterr ()
132
132
assert "Get it done right away!" in out
0 commit comments