When running the tests in a container/chroot, where /etc/resolv.conf is missing, test error:
======================================= ERRORS ========================================
____________________ ERROR collecting tests/test_deliverability.py ____________________
/gnu/store/796pv4r9rixyvcqwd5q7bbbybhc0dk48-python-dnspython-2.1.0/lib/python3.10/site-packages/dns/resolver.py:782: in read_resolv_conf
f = stack.enter_context(open(f))
E FileNotFoundError: [Errno 2] No such file or directory: '/etc/resolv.conf'
During handling of the above exception, another exception occurred:
tests/test_deliverability.py:10: in <module>
RESOLVER = MockedDnsResponseData.create_resolver()
tests/mocked_dns_response.py:35: in create_resolver
return caching_resolver(cache=MockedDnsResponseData.INSTANCE)
email_validator/deliverability.py:13: in caching_resolver
resolver = dns.resolver.Resolver()
/gnu/store/796pv4r9rixyvcqwd5q7bbbybhc0dk48-python-dnspython-2.1.0/lib/python3.10/site-packages/dns/resolver.py:734: in __init__
self.read_resolv_conf(filename)
/gnu/store/796pv4r9rixyvcqwd5q7bbbybhc0dk48-python-dnspython-2.1.0/lib/python3.10/site-packages/dns/resolver.py:785: in read_resolv_conf
raise NoResolverConfiguration
E dns.resolver.NoResolverConfiguration: Resolver configuration could not be read or specified no nameservers.
_________________________ ERROR collecting tests/test_main.py _________________________
/gnu/store/796pv4r9rixyvcqwd5q7bbbybhc0dk48-python-dnspython-2.1.0/lib/python3.10/site-packages/dns/resolver.py:782: in read_resolv_conf
f = stack.enter_context(open(f))
E FileNotFoundError: [Errno 2] No such file or directory: '/etc/resolv.conf'
During handling of the above exception, another exception occurred:
tests/test_main.py:9: in <module>
RESOLVER = MockedDnsResponseData.create_resolver()
tests/mocked_dns_response.py:35: in create_resolver
return caching_resolver(cache=MockedDnsResponseData.INSTANCE)
email_validator/deliverability.py:13: in caching_resolver
resolver = dns.resolver.Resolver()
/gnu/store/796pv4r9rixyvcqwd5q7bbbybhc0dk48-python-dnspython-2.1.0/lib/python3.10/site-packages/dns/resolver.py:734: in __init__
self.read_resolv_conf(filename)
/gnu/store/796pv4r9rixyvcqwd5q7bbbybhc0dk48-python-dnspython-2.1.0/lib/python3.10/site-packages/dns/resolver.py:785: in read_resolv_conf
raise NoResolverConfiguration
E dns.resolver.NoResolverConfiguration: Resolver configuration could not be read or specified no nameservers.
The example above stems from trying to run the tests as part of building a Guic package. Guix (like nix) build packages in a very slim container.
Expected result
Tests pass even if /etc/resolv.conv does not exist.
When running the tests in a container/chroot, where
/etc/resolv.conf
is missing, test error:The example above stems from trying to run the tests as part of building a Guic package. Guix (like nix) build packages in a very slim container.
Expected result
Tests pass even if
/etc/resolv.conv
does not exist.