def test_bad_algo_option(script, tmpdir):
 result = script.pip('hash', '-a', 'poppycock', _hello_file(tmpdir), expect_error=True)
 assert ("invalid choice: 'poppycock'" in str(result))

def test_bad_algo_option ( script , tmpdir ) : result = script . pip ( 'hash' , '-a' , 'poppycock' , _hello_file ( tmpdir ) , expect_error = True ) assert ( "invalid choice: 'poppycock'" in str ( result ) )
make sure the -a option raises an error when given a bad operand .