Best Python code snippet using refurb_python
test_arg_parsing.py
Source:test_arg_parsing.py
...4from refurb.settings import parse_command_line_args as parse_args5from refurb.settings import parse_config_file, parse_error_id6def test_parse_explain():7 assert parse_args(["--explain", "123"]) == Settings(explain=ErrorCode(123))8def test_parse_explain_missing_option() -> None:9 msg = 'refurb: missing argument after "--explain"'10 with pytest.raises(ValueError, match=msg):11 parse_args(["--explain"])12def test_parse_explain_furb_prefix() -> None:13 assert parse_args(["--explain", "FURB123"]) == Settings(14 explain=ErrorCode(123)15 )16def test_require_numbers_as_explain_id() -> None:17 with pytest.raises(18 ValueError, match='refurb: "abc" must be in form FURB123 or 123'19 ):20 parse_args(["--explain", "abc"])21def test_parse_files() -> None:22 assert parse_args(["a", "b", "c"]) == Settings(files=["a", "b", "c"])...
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!!