File tree Expand file tree Collapse file tree 3 files changed +3
-8
lines changed
Expand file tree Collapse file tree 3 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 77
88The gpiozero package contains a database of information about the various
99revisions of Raspberry Pi. This is queried by the ``pinout `` command-line
10- tool to write details of the GPIO pins available.
10+ tool to output details of the GPIO pins available.
1111
1212Unless specified, the revision of the current device will be detected. A
1313particular revision may be selected with the --revision command-line
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def parse_args(args):
4545 except argparse .ArgumentError as ex :
4646 print ('Error parsing arguments.' )
4747 parser .error (str (ex .message ))
48- exit (- 1 )
48+ sys . exit (1 )
4949 return args
5050
5151
@@ -57,7 +57,7 @@ def main():
5757 pi_info ().pprint (color = args .color )
5858 except IOError :
5959 print ('This device is not a Raspberry Pi' )
60- exit (2 )
60+ sys . exit (1 )
6161 else :
6262 pi_info (args .revision ).pprint (color = args .color )
6363
Original file line number Diff line number Diff line change 1515def test_args_incorrect ():
1616 with pytest .raises (SystemExit ) as ex :
1717 pinout .parse_args (['--nonexistentarg' ])
18- assert ex .value .code == 2
19-
2018
2119def test_args_color ():
2220 args = pinout .parse_args ([])
@@ -26,15 +24,12 @@ def test_args_color():
2624 args = pinout .parse_args (['--monochrome' ])
2725 assert args .color is False
2826
29-
3027def test_args_revision ():
3128 args = pinout .parse_args (['--revision' , '000d' ])
3229 assert args .revision == '000d'
3330
34-
3531def test_help (capsys ):
3632 with pytest .raises (SystemExit ) as ex :
3733 pinout .parse_args (['--help' ])
3834 out , err = capsys .readouterr ()
3935 assert 'GPIO pinout' in out
40- assert ex .value .code == 0
You can’t perform that action at this time.
0 commit comments