tox-dev / tox

@@ -49,7 +49,7 @@
Loading
49 49
        parser.add_argument("--hash", action=AddSortedUniqueAction, type=_validate_hash)
50 50
51 51
52 -
_HASH = re.compile(r"sha(256:[a-z0-9]{64}|384:[a-z0-9]{96}|512:[a-z0-9]{128})")
52 +
_HASH = re.compile(r"sha(256:[a-f0-9]{64}|384:[a-f0-9]{96}|512:[a-f0-9]{128})")
53 53
54 54
55 55
def _validate_hash(value: str) -> str:

@@ -372,11 +372,20 @@
Loading
372 372
    assert found == ["c"]
373 373
374 374
375 -
def test_bad_hash(tmp_path: Path) -> None:
375 +
@pytest.mark.parametrize(
376 +
    "hash_value",
377 +
    [
378 +
        "sha256:a",
379 +
        "sha256:xxxxxxxxxx123456789012345678901234567890123456789012345678901234",
380 +
        "sha512:thisshouldfail8525e477385ef5ee6cecdc8f8fcc2a79d1b35a9f57ad15c814"
381 +
        "dada670026f41fdd62e5e10b3fd75d6112704a9521c3df105f0b6f3bb11b128a",
382 +
    ],
383 +
)
384 +
def test_bad_hash(hash_value: str, tmp_path: Path) -> None:
376 385
    requirements_txt = tmp_path / "req.txt"
377 -
    requirements_txt.write_text("attrs --hash sha256:a")
386 +
    requirements_txt.write_text(f"attrs --hash {hash_value}")
378 387
    req_file = RequirementsFile(requirements_txt, constraint=False)
379 -
    with pytest.raises(ValueError, match="^argument --hash: sha256:a$"):
388 +
    with pytest.raises(ValueError, match=f"^argument --hash: {hash_value}$"):
380 389
        assert req_file.requirements
381 390
382 391
Files Coverage
src/tox 99.73%
tests 100.00%
Project Totals (152 files) 99.83%
3.8 - Windows
Build #749220701 -
tests
3.8 - MacOs
Build #749220701 -
tests
3.7 - MacOs
Build #749220701 -
tests
3.10.0-alpha.7 - MacOs
Build #749220701 -
tests
3.10.0-alpha.7 - Windows
Build #749220701 -
tests
3.7 - Ubuntu
Build #749220701 -
tests
3.9 - Ubuntu
Build #749220701 -
tests
3.6 - Ubuntu
Build #749220701 -
tests
3.8 - Ubuntu
Build #749220701 -
tests
3.6 - MacOs
Build #749220701 -
tests
3.9 - MacOs
Build #749220701 -
tests
3.9 - Windows
Build #749220701 -
tests
3.10.0-alpha.7 - Ubuntu
Build #749220701 -
tests
3.6 - Windows
Build #749220701 -
tests
3.7 - Windows
Build #749220701 -
tests

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading