python-email-validator
python-email-validator copied to clipboard
test failures: TypeError: Expected int, got Flag
I bumped into this while upgrading python to 3.12 on Alpine Linux.
======================================= test session starts ========================================
platform linux -- Python 3.12.2, pytest-8.0.2, pluggy-1.4.0
rootdir: /home/ncopa/aports/community/py3-email-validator/src/python-email-validator-2.1.1
configfile: setup.cfg
testpaths: tests
collected 257 items / 2 errors
============================================== ERRORS ==============================================
__________________________ ERROR collecting tests/test_deliverability.py ___________________________
tests/test_deliverability.py:6: in <module>
from email_validator.deliverability import validate_email_deliverability
email_validator/deliverability.py:5: in <module>
import dns.resolver
dns/resolver.py:30: in init dns.resolver
???
dns/_ddr.py:12: in init dns._ddr
???
dns/nameserver.py:5: in init dns.nameserver
???
dns/asyncquery.py:30: in init dns.asyncquery
???
dns/message.py:1679: in init dns.message
???
E TypeError: Expected int, got Flag
_______________________________ ERROR collecting tests/test_main.py ________________________________
tests/test_main.py:5: in <module>
from email_validator.__main__ import main as validator_command_line_tool
email_validator/__main__.py:22: in <module>
from .deliverability import caching_resolver
email_validator/deliverability.py:5: in <module>
import dns.resolver
dns/resolver.py:30: in init dns.resolver
???
dns/_ddr.py:12: in init dns._ddr
???
dns/nameserver.py:5: in init dns.nameserver
???
dns/asyncquery.py:30: in init dns.asyncquery
???
dns/message.py:1679: in init dns.message
???
E TypeError: Expected int, got Flag
===================================== short test summary info ======================================
ERROR tests/test_deliverability.py - TypeError: Expected int, got Flag
ERROR tests/test_main.py - TypeError: Expected int, got Flag
!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================== 2 errors in 0.08s =========================================
This does not appear to happen with python 3.11
The automated builds are passing on Python 3.12.0:
https://github.com/JoshData/python-email-validator/actions/runs/8058883604/job/22012375165
It could be that 3.12.2 broke something, or something else must be different about your environment.
The error is happening in the dnspython library. So it may be an issue for them, not for me. Either way, I would first check that you have the latest version of dnspython installed, or version 2.6.1 which is the version used in this project's automated builds.