Best Python code snippet using refurb_python
test_arg_parsing.py
Source:test_arg_parsing.py
...22 assert parse_args(["a", "b", "c"]) == Settings(files=["a", "b", "c"])23def test_check_for_unsupported_flags() -> None:24 with pytest.raises(ValueError, match='refurb: unsupported option "-x"'):25 parse_args(["-x"])26def test_parse_help_args() -> None:27 assert parse_args([]) == Settings(help=True)28 assert parse_args(["--help"]) == Settings(help=True)29 assert parse_args(["-h"]) == Settings(help=True)30def test_parse_version_args() -> None:31 assert parse_args(["--version"]) == Settings(version=True)32 assert parse_args(["-v"]) == Settings(version=True)33def test_parse_ignore() -> None:34 got = parse_args(["--ignore", "FURB123", "--ignore", "321"])35 expected = Settings(ignore=set((ErrorCode(123), ErrorCode(321))))36 assert got == expected37def test_parse_ignore_check_missing_arg() -> None:38 with pytest.raises(39 ValueError, match='refurb: missing argument after "--ignore"'40 ):...
test_cli.py
Source:test_cli.py
...13{PNAME}: error: the following arguments are required: action14""".lstrip()15 captured = capsys.readouterr()16 assert captured.err == expected17def test_parse_help_args(capsys):18 args = ["--help"]19 pytest.raises(SystemExit, mono2repo.parse_args, args)20 fixes = {21 "optional arguments": "optional arguments",22 }23 if pyv >= (3, 10):24 fixes["optional arguments"] = "options"25 expected = f"""26usage: {PNAME} [-h] [--version] {{init,update}} ...27Create a new git checkout from a git repo.28{fixes['optional arguments']}:29 -h, --help show this help message and exit30 --version show program's version number and exit31actions:...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!