{"id":25869561,"url":"https://github.com/best-doctor/pytest_network","last_synced_at":"2026-03-06T13:04:26.604Z","repository":{"id":37597170,"uuid":"234568376","full_name":"best-doctor/pytest_network","owner":"best-doctor","description":"A simple pytest plugin to disable network on socket level.","archived":false,"fork":false,"pushed_at":"2021-01-12T13:14:44.000Z","size":27,"stargazers_count":15,"open_issues_count":5,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-22T20:18:24.927Z","etag":null,"topics":["network","pytest","pytest-plugin","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/best-doctor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-17T14:45:26.000Z","updated_at":"2024-12-02T13:41:39.000Z","dependencies_parsed_at":"2022-09-01T09:11:58.207Z","dependency_job_id":null,"html_url":"https://github.com/best-doctor/pytest_network","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/best-doctor/pytest_network","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/best-doctor%2Fpytest_network","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/best-doctor%2Fpytest_network/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/best-doctor%2Fpytest_network/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/best-doctor%2Fpytest_network/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/best-doctor","download_url":"https://codeload.github.com/best-doctor/pytest_network/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/best-doctor%2Fpytest_network/sbom","scorecard":{"id":234856,"data":{"date":"2025-08-11","repo":{"name":"github.com/best-doctor/pytest_network","commit":"4e98d816fb93bcbdac4593710ff9b2d38d16134d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 3/26 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T05:26:48.309Z","repository_id":37597170,"created_at":"2025-08-17T05:26:48.310Z","updated_at":"2025-08-17T05:26:48.310Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30178286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T12:39:21.703Z","status":"ssl_error","status_checked_at":"2026-03-06T12:36:09.819Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["network","pytest","pytest-plugin","testing-tools"],"created_at":"2025-03-02T05:18:36.852Z","updated_at":"2026-03-06T13:04:26.576Z","avatar_url":"https://github.com/best-doctor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pytest-network\n\n[![Build Status](https://travis-ci.org/best-doctor/pytest_network.svg?branch=master)](https://travis-ci.org/best-doctor/pytest_network)\n[![Maintainability](https://api.codeclimate.com/v1/badges/1f243263e78f38f92a31/maintainability)](https://codeclimate.com/github/best-doctor/pytest_network/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/1f243263e78f38f92a31/test_coverage)](https://codeclimate.com/github/best-doctor/pytest_network/test_coverage)\n[![PyPI version](https://badge.fury.io/py/pytest_network.svg)](https://badge.fury.io/py/pytest_network)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytest_network)](https://pypi.org/project/pytest_network/)\n\nA simple pytest plugin to disable network on socket level.\n\n## Installation\n\n`$ pip install pytest-network`\n\n## Usage\n\n`pytest-network` has a flag `--disable-network` that will raise an error\nif tests will try to use `socket.socket.connect`\n\nYou can use it directly like:\n\n`$ python3 -m pytest --disable-network`\n\nor add this flag as the default behavior in your `pytest.ini`:\n\n```ini\n[pytest]\naddopts = --disable-network\n```\n\nAlso you can directly disable network:\n\n```python3\nimport requests\n\n\ndef test_network_request_raises_error(disable_network):\n    response = requests.get('https://github.com')  # this will raise an exception\n\n    assert response.status_code == 200\n```\n\nor directly enable (if you have default `--disable-network` flag):\n\n```python3\nimport requests\n\n\ndef test_network_request_is_ok(enable_network):\n    response = requests.get('https://github.com')\n\n    assert response.status_code == 200  # this will pass\n```\n\nYou can use test marks instead of fixtures: add `@pytest.mark.disable_network`\nor `@pytest.mark.enable_network` to disable or enable network in test.\n\n## Development\n\nTo setup development environment you must first create a virtual environment.\nFor example:\n\n`$ python3.8 -m venv \u003cvenv-name\u003e`\n\nAfter that install all requirements:\n\n`$ pip install -r requirements.txt`\n\nAnd install plugin itself (inside project directory and virtual environment):\n\n`$ pip install -e .`\n\nCheck that tests are running:\n\n`$ make test`\n\n## Contributing\n\nWe would love you to contribute to our project. It's simple:\n\n* Create an issue with bug you found or proposal you have.\n  Wait for approve from maintainer.\n* Create a pull request. Make sure all checks are green.\n* Fix review comments if any.\n* Be awesome.\n\nHere are useful tips:\n\n* You can run all checks and tests with make check.\n  Please do it before TravisCI does.\n* We use [BestDoctor python styleguide](https://github.com/best-doctor/guides/blob/master/guides/en/python_styleguide.md).\n* We respect [Django CoC](https://www.djangoproject.com/conduct/).\n  Make soft, not bullshit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbest-doctor%2Fpytest_network","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbest-doctor%2Fpytest_network","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbest-doctor%2Fpytest_network/lists"}