I'm trying to package your module as an rpm package. So I'm using the typical build, install and test cycle used on building packages from non-root account.
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-zeroconf-0.36.9-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-zeroconf-0.36.9-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9, configfile: setup.cfg, testpaths: tests
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, flake8-1.0.7, xdist-2.3.0, cov-2.12.1
collected 112 items / 6 errors / 106 selected
================================================================================== ERRORS ==================================================================================
___________________________________________________________________ ERROR collecting tests/test_core.py ____________________________________________________________________
tests/test_core.py:105: in <module>
class Framework(unittest.TestCase):
tests/test_core.py:132: in Framework
???
tests/__init__.py:68: in has_working_ipv6
if sock:
E UnboundLocalError: local variable 'sock' referenced before assignment
____________________________________________________________________ ERROR collecting tests/test_dns.py ____________________________________________________________________
tests/test_dns.py:39: in <module>
class TestDunder(unittest.TestCase):
tests/test_dns.py:58: in TestDunder
???
tests/__init__.py:68: in has_working_ipv6
if sock:
E UnboundLocalError: local variable 'sock' referenced before assignment
_________________________________________________________________ ERROR collecting tests/test_handlers.py __________________________________________________________________
tests/test_handlers.py:287: in <module>
???
tests/__init__.py:68: in has_working_ipv6
if sock:
E UnboundLocalError: local variable 'sock' referenced before assignment
_________________________________________________________________ ERROR collecting tests/test_protocol.py __________________________________________________________________
tests/test_protocol.py:475: in <module>
class TestDnsIncoming(unittest.TestCase):
tests/test_protocol.py:503: in TestDnsIncoming
???
tests/__init__.py:68: in has_working_ipv6
if sock:
E UnboundLocalError: local variable 'sock' referenced before assignment
_______________________________________________________________ ERROR collecting tests/services/test_info.py _______________________________________________________________
tests/services/test_info.py:41: in <module>
class TestServiceInfo(unittest.TestCase):
tests/services/test_info.py:195: in TestServiceInfo
???
tests/__init__.py:68: in has_working_ipv6
if sock:
E UnboundLocalError: local variable 'sock' referenced before assignment
______________________________________________________________ ERROR collecting tests/services/test_types.py _______________________________________________________________
tests/services/test_types.py:34: in <module>
class ServiceTypesQuery(unittest.TestCase):
tests/services/test_types.py:69: in ServiceTypesQuery
???
tests/__init__.py:68: in has_working_ipv6
if sock:
E UnboundLocalError: local variable 'sock' referenced before assignment
============================================================================= warnings summary =============================================================================
tests/test_asyncio.py:70
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:70: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:77
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:77: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:85
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:85: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:94
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:94: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:104
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:104: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:116
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:116: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:176
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:176: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:243
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:243: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:310
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:310: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:358
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:358: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:384
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:384: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:450
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:450: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:486
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:486: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:588
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:588: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:648
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:648: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:672
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:672: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:731
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:731: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:765
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:765: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:776
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:776: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:825
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:825: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:941
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:941: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:988
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:988: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:1079
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:1079: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_asyncio.py:1093
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_asyncio.py:1093: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_core.py:51
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_core.py:51: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/test_core.py:87
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/test_core.py:87: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/services/test_browser.py:925
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/services/test_browser.py:925: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/services/test_browser.py:976
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/services/test_browser.py:976: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/utils/test_asyncio.py:21
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/utils/test_asyncio.py:21: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/utils/test_asyncio.py:35
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/utils/test_asyncio.py:35: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
tests/utils/test_asyncio.py:46
/home/tkloczko/rpmbuild/BUILD/python-zeroconf-0.36.9/tests/utils/test_asyncio.py:46: PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.asyncio
-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
ERROR tests/test_core.py - UnboundLocalError: local variable 'sock' referenced before assignment
ERROR tests/test_dns.py - UnboundLocalError: local variable 'sock' referenced before assignment
ERROR tests/test_handlers.py - UnboundLocalError: local variable 'sock' referenced before assignment
ERROR tests/test_protocol.py - UnboundLocalError: local variable 'sock' referenced before assignment
ERROR tests/services/test_info.py - UnboundLocalError: local variable 'sock' referenced before assignment
ERROR tests/services/test_types.py - UnboundLocalError: local variable 'sock' referenced before assignment
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 6 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================================== 31 warnings, 6 errors in 1.04s ======================================================================
I'm trying to package your module as an rpm package. So I'm using the typical build, install and test cycle used on building packages from non-root account.
May I ask for help because few units are ending with errors: