11#!/usr/bin/env python3
22
3- from pathlib import Path
43import os
54import subprocess
65import unittest
6+ from pathlib import Path
77
88
99class PipInstallTest (unittest .TestCase ):
@@ -16,13 +16,23 @@ def test_entry_point_void_return(self):
1616 entry_point = Path (env )
1717 self .assertTrue (entry_point .exists ())
1818
19- proc = subprocess .run ([entry_point , "--version" ], check = True , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
19+ proc = subprocess .run (
20+ [entry_point , "--version" ],
21+ check = True ,
22+ stdout = subprocess .PIPE ,
23+ stderr = subprocess .PIPE ,
24+ )
2025 self .assertEqual (proc .stdout .decode ("utf-8" ).strip (), "yamllint 1.26.3" )
2126
2227 # yamllint entry_point is of the form `def run(argv=None):`
2328 with self .assertRaises (subprocess .CalledProcessError ) as context :
24- subprocess .run ([entry_point , "--option-does-not-exist" ], check = True , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
25- self .assertIn ('returned non-zero exit status 2' , str (context .exception ))
29+ subprocess .run (
30+ [entry_point , "--option-does-not-exist" ],
31+ check = True ,
32+ stdout = subprocess .PIPE ,
33+ stderr = subprocess .PIPE ,
34+ )
35+ self .assertIn ("returned non-zero exit status 2" , str (context .exception ))
2636
2737 def test_entry_point_int_return (self ):
2838 env = os .environ .get ("SPHINX_BUILD_ENTRY_POINT" )
@@ -31,14 +41,24 @@ def test_entry_point_int_return(self):
3141 entry_point = Path (env )
3242 self .assertTrue (entry_point .exists ())
3343
34- proc = subprocess .run ([entry_point , "--version" ], check = True , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
44+ proc = subprocess .run (
45+ [entry_point , "--version" ],
46+ check = True ,
47+ stdout = subprocess .PIPE ,
48+ stderr = subprocess .PIPE ,
49+ )
3550 # sphinx-build uses args[0] for its name, only assert the version here
36- self .assertTrue (proc .stdout .decode ("utf-8" ).strip ().endswith (' 4.2.0' ))
51+ self .assertTrue (proc .stdout .decode ("utf-8" ).strip ().endswith (" 4.2.0" ))
3752
3853 # sphinx-build entry_point is of the form `def main(argv: List[str] = sys.argv[1:]) -> int:`
3954 with self .assertRaises (subprocess .CalledProcessError ) as context :
40- subprocess .run ([entry_point , "--option-does-not-exist" ], check = True , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
41- self .assertIn ('returned non-zero exit status 2' , str (context .exception ))
55+ subprocess .run (
56+ [entry_point , "--option-does-not-exist" ],
57+ check = True ,
58+ stdout = subprocess .PIPE ,
59+ stderr = subprocess .PIPE ,
60+ )
61+ self .assertIn ("returned non-zero exit status 2" , str (context .exception ))
4262
4363 def test_data (self ):
4464 env = os .environ .get ("WHEEL_DATA_CONTENTS" )
0 commit comments