Monkeypatch sys.argv instead of using an argument to main()

Just a style thing... didn't want to complicate the main func
for the sake of a couple tests
This commit is contained in:
Joe Rickerby
2021-10-17 21:24:03 +01:00
parent 08a694485d
commit 4f53583801
2 changed files with 12 additions and 6 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ import argparse
import os
import sys
import textwrap
from typing import List, Optional, Set, Union
from typing import List, Set, Union
import cibuildwheel
import cibuildwheel.linux
@@ -15,7 +15,7 @@ from cibuildwheel.typing import PLATFORMS, PlatformName, assert_never
from cibuildwheel.util import BuildSelector, Unbuffered, detect_ci_provider
def main(sys_args: Optional[List[str]] = None) -> None:
def main() -> None:
platform: PlatformName
parser = argparse.ArgumentParser(
@@ -98,7 +98,7 @@ def main(sys_args: Optional[List[str]] = None) -> None:
help="Enable pre-release Python versions if available.",
)
args = parser.parse_args(args=sys_args, namespace=CommandLineArguments())
args = parser.parse_args(namespace=CommandLineArguments())
if args.platform != "auto":
platform = args.platform