Entries may be hostnames, IP addresses, or CIDR network ranges such as
192.168.0.0/24.
Frequently Asked Questions
Q: Why is network access disabled in some of my tests but not others?
A: pytest's default fixture scope is "function", which socket_enabled uses.
If you create another fixture that creates a socket usage that has a "higher"
instantiation order, such as at the module/class/session, then the higher order
fixture will be resolved first, and won't be disabled during the tests.
Read more in this excellent example
and more about pytest fixture order here.
This behavior may change in the future, as we learn more about pytest
fixture order, and what users expect to happen.
Contributing
Contributions are very welcome. Tests can be run with
pytest, please ensure the
coverage at least stays the same before you submit a pull request.
License
Distributed under the terms of the
MIT license, "pytest-socket" is
free and open source software
Issues
If you encounter any problems, please file an issue
along with a detailed description.