FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: add fuzzing coverage for incoming packet parsing by bdraco · Pull Request #1829 · python-zeroconf/python-zeroconf · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .lock  (1) .py  (2) .toml  (1) dotfile  (1) All 4 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 1 addition & 0 deletions .gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ docs/_build/
/dist/
/zeroconf.egg-info/
/src/**/*.c
.hypothesis/
129 changes: 128 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ setuptools = ">=83.0.0,<84.0.0"
pytest-timeout = "^2.1.0"
pytest-codspeed = ">=5.0.3,<6.0"
blockbuster = ">=1.5.27,<2.0.0"
hypothesis = {version = "^6.165.10", markers = "implementation_name == 'cpython'"}

[tool.poetry.group.docs.dependencies]
sphinx = "^7.4.7 || ^8.1.3"
Expand Down
16 changes: 16 additions & 0 deletions tests/conftest.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from __future__ import annotations

import importlib.util
import os
import threading
from collections.abc import AsyncGenerator, Generator, Iterator
from unittest.mock import patch
Expand All @@ -15,6 +17,20 @@
from zeroconf._services import info as service_info
from zeroconf.asyncio import AsyncZeroconf

# The dev dependency group only installs hypothesis on CPython (the CI
# matrix pins pypy-3.10 and hypothesis ships no pp310 wheels), and a
# non-dev install has no hypothesis at all.
collect_ignore: list[str] = []
if importlib.util.find_spec("hypothesis") is None:
collect_ignore.append("test_fuzz_incoming.py")
else:
from hypothesis import settings as _hypothesis_settings

# Deterministic in CI; set HYPOTHESIS_PROFILE=long for a deep local run.
_hypothesis_settings.register_profile("ci", derandomize=True, max_examples=200, deadline=None)
_hypothesis_settings.register_profile("long", max_examples=50000, deadline=None)
_hypothesis_settings.load_profile(os.environ.get("HYPOTHESIS_PROFILE", "ci"))

try:
from blockbuster import BlockBuster, blockbuster_ctx
except ImportError: # platforms without blockbuster (e.g. PyPy under QEMU)
Expand Down
Loading
Loading

Back | FazBrowse Home | New Git URL