Advertisement
AntonyZhilin

Untitled

Jun 20th, 2024
717
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.19 KB | None | 0 0
  1. Index: userver/testsuite/create_runner.py
  2. IDEA additional info:
  3. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  4. <+>UTF-8
  5. ===================================================================
  6. diff --git a/userver/testsuite/create_runner.py b/userver/testsuite/create_runner.py
  7. --- a/userver/testsuite/create_runner.py
  8. +++ b/userver/testsuite/create_runner.py
  9. @@ -53,10 +53,7 @@
  10.          default=[],
  11.          help='Semicolon separated Python path',
  12.      )
  13. -    parser.add_argument(
  14. -        'pytest_args', nargs='*', help='Extra pytest arguments',
  15. -    )
  16. -    args = parser.parse_args()
  17. +    args, unknown_args = parser.parse_known_args()
  18.  
  19.      if not args.python.exists():
  20.          parser.exit(
  21. @@ -64,10 +61,13 @@
  22.              message=f'Invalid path to python interpreter: {args.python}\n',
  23.          )
  24.  
  25. +    if unknown_args and unknown_args[0] == '--':
  26. +        del unknown_args[0]
  27. +
  28.      script = TEMPLATE.format(
  29.          python=args.python,
  30.          python_path=pprint.pformat(args.python_path),
  31. -        pytest_args=pprint.pformat(args.pytest_args),
  32. +        pytest_args=pprint.pformat(unknown_args),
  33.      )
  34.      args.output.write_text(script)
  35.      args.output.chmod(0o755)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement