def test_call_with_wrong_operation(parser): with pytest.raises(SystemExit): args = parser.parse_args(['--sum', '10']) call_calculator(args=args)
def test_div_operations(parser, args, expected): args = parser.parse_args(['--div'] + args) assert call_calculator(args) == expected
def test_one_arg_no_numbers_exits(parser): with pytest.raises(SystemExit): args = parser.parse_args(['--add']) call_calculator(args=args)