(
script, # type: str
script2, # type: str
)
| 83 | |
| 84 | |
| 85 | def test_multiple( |
| 86 | script, # type: str |
| 87 | script2, # type: str |
| 88 | ): |
| 89 | # type: (...) -> None |
| 90 | |
| 91 | result = script_metadata.apply_script_metadata( |
| 92 | [script, script2], |
| 93 | target_configuration=TargetConfiguration( |
| 94 | interpreter_configuration=InterpreterConfiguration( |
| 95 | interpreter_constraints=InterpreterConstraints.parse("!=3.10.*") |
| 96 | ) |
| 97 | ), |
| 98 | ) |
| 99 | assert ( |
| 100 | ScriptMetadata( |
| 101 | dependencies=tuple([parse_requirement_string("cowsay==5.0")]), |
| 102 | requires_python=SpecifierSet(">=3.8"), |
| 103 | source=script, |
| 104 | ), |
| 105 | ScriptMetadata( |
| 106 | dependencies=tuple([parse_requirement_string("ansicolors==1.1.8")]), |
| 107 | requires_python=SpecifierSet("<3.14"), |
| 108 | source=script2, |
| 109 | ), |
| 110 | ) == result.scripts |
| 111 | assert result.requirement_configuration.requirements is not None |
| 112 | assert list(parse_requirement_strings(("cowsay==5.0", "ansicolors==1.1.8"))) == list( |
| 113 | result.requirement_configuration.requirements |
| 114 | ) |
| 115 | assert ( |
| 116 | InterpreterConstraints.parse(">=3.8,!=3.10.*,<3.14") |
| 117 | == result.target_configuration.interpreter_configuration.interpreter_constraints |
| 118 | ) |
| 119 | |
| 120 | |
| 121 | @pytest.fixture |
nothing calls this directly
no test coverage detected