Test that join produces strings understood by subprocess
(Parser, runner, argv)
| 53 | @pytest.mark.skipif(IS_WASM, reason="Cannot start subprocess") |
| 54 | @pytest.mark.parametrize('argv', argv_cases) |
| 55 | def test_join_matches_subprocess(Parser, runner, argv): |
| 56 | """ |
| 57 | Test that join produces strings understood by subprocess |
| 58 | """ |
| 59 | # invoke python to return its arguments as json |
| 60 | cmd = [ |
| 61 | sys.executable, '-c', |
| 62 | 'import json, sys; print(json.dumps(sys.argv[1:]))' |
| 63 | ] |
| 64 | joined = Parser.join(cmd + argv) |
| 65 | json_out = runner(joined).decode() |
| 66 | assert json.loads(json_out) == argv |
| 67 | |
| 68 | |
| 69 | @pytest.mark.skipif(IS_WASM, reason="Cannot start subprocess") |