Code Monkey home page Code Monkey logo

Comments (5)

kloczek avatar kloczek commented on July 4, 2024 1

Closing.
Looks like latest 4.2.1 version no longer fails

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pycares-4.2.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pycares-4.2.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra tests/tests.py
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pycares-pycares-4.2.1
plugins: subtests-0.7.0, timeout-2.1.0
collected 54 items

tests/tests.py ..................xx.........s.................x..xs..                                                                                                [100%]

========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/tests.py:430: ANY type does not work on Mac.
SKIPPED [1] tests/tests.py:537: The site used for this test no longer returns a non-ascii SOA.
XFAIL tests/tests.py::DNSTest::test_getnameinfo_ipv6
  reason:
XFAIL tests/tests.py::DNSTest::test_getnameinfo_ipv6_ll
  reason:
XFAIL tests/tests.py::DNSTest::test_query_txt_bytes2
  reason:
XFAIL tests/tests.py::DNSTest::test_query_txt_multiple_chunked_with_non_ascii_content
  reason:
================================================================ 48 passed, 2 skipped, 4 xfailed in 21.92s =================================================================

from pycares.

saghul avatar saghul commented on July 4, 2024

What c-ares version do you have in your system?

I'm not familiar with pytest.ini, what should go in there?

from pycares.

kloczek avatar kloczek commented on July 4, 2024

I'm using c-ares 1.18.1.

I'm not familiar with pytest.ini, what should go in there?

Firs it would be good to complete set of pytest parametrs which will be producing correct testtin (+ eventually some test suite corrections) than all cold be coded to pytest.ini to project.toml :)

from pycares.

kloczek avatar kloczek commented on July 4, 2024

Gentle ping .. 😄

from pycares.

kloczek avatar kloczek commented on July 4, 2024

Just FTR.
New 4.2.0 still fails but in one unit less.
Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pycares-4.2.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pycares-4.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra tests/tests.py
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pycares-pycares-4.2.0
collected 54 items

tests/tests.py ........FFFFF.....xx.........s.................x..xs..                                                                                                [100%]

================================================================================= FAILURES =================================================================================
_________________________________________________________________________ DNSTest.test_getaddrinfo _________________________________________________________________________

self = <tests.DNSTest testMethod=test_getaddrinfo>

    @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows')
    def test_getaddrinfo(self):
        self.result, self.errorno = None, None
        def cb(result, errorno):
            self.result, self.errorno = result, errorno
        self.channel.getaddrinfo('localhost', 80, cb)
        self.wait()
        self.assertNoError(self.errorno)
>       self.assertEqual(type(self.result), pycares.ares_addrinfo_result)
E       AssertionError: <class 'NoneType'> != <class 'pycares.ares_addrinfo_result'>

tests/tests.py:52: AssertionError
________________________________________________________________________ DNSTest.test_getaddrinfo2 _________________________________________________________________________

self = <tests.DNSTest testMethod=test_getaddrinfo2>

    @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows')
    def test_getaddrinfo2(self):
        self.result, self.errorno = None, None
        def cb(result, errorno):
            self.result, self.errorno = result, errorno
        self.channel.getaddrinfo('localhost', 'http', cb)
        self.wait()
        self.assertNoError(self.errorno)
>       self.assertEqual(type(self.result), pycares.ares_addrinfo_result)
E       AssertionError: <class 'NoneType'> != <class 'pycares.ares_addrinfo_result'>

tests/tests.py:65: AssertionError
________________________________________________________________________ DNSTest.test_getaddrinfo3 _________________________________________________________________________

self = <tests.DNSTest testMethod=test_getaddrinfo3>

    @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows')
    def test_getaddrinfo3(self):
        self.result, self.errorno = None, None
        def cb(result, errorno):
            self.result, self.errorno = result, errorno
        self.channel.getaddrinfo('localhost', None, cb)
        self.wait()
        self.assertNoError(self.errorno)
>       self.assertEqual(type(self.result), pycares.ares_addrinfo_result)
E       AssertionError: <class 'NoneType'> != <class 'pycares.ares_addrinfo_result'>

tests/tests.py:78: AssertionError
________________________________________________________________________ DNSTest.test_getaddrinfo4 _________________________________________________________________________

self = <tests.DNSTest testMethod=test_getaddrinfo4>

    @unittest.skipIf(sys.platform == 'win32', 'skipped on Windows')
    def test_getaddrinfo4(self):
        self.result, self.errorno = None, None
        def cb(result, errorno):
            self.result, self.errorno = result, errorno
        self.channel.getaddrinfo('localhost', 'http', cb, family=socket.AF_INET)
        self.wait()
        self.assertNoError(self.errorno)
>       self.assertEqual(type(self.result), pycares.ares_addrinfo_result)
E       AssertionError: <class 'NoneType'> != <class 'pycares.ares_addrinfo_result'>

tests/tests.py:91: AssertionError
________________________________________________________________________ DNSTest.test_getaddrinfo5 _________________________________________________________________________

self = <tests.DNSTest testMethod=test_getaddrinfo5>

    def test_getaddrinfo5(self):
        self.result, self.errorno = None, None
        def cb(result, errorno):
            self.result, self.errorno = result, errorno
        self.channel.getaddrinfo('google.com', 'http', cb)
        self.wait()
        self.assertNoError(self.errorno)
>       self.assertEqual(type(self.result), pycares.ares_addrinfo_result)
E       AssertionError: <class 'NoneType'> != <class 'pycares.ares_addrinfo_result'>

tests/tests.py:104: AssertionError
============================================================================= warnings summary =============================================================================
tests/tests.py::DNSTest::test_getaddrinfo
tests/tests.py::DNSTest::test_getaddrinfo2
tests/tests.py::DNSTest::test_getaddrinfo3
tests/tests.py::DNSTest::test_getaddrinfo4
tests/tests.py::DNSTest::test_getaddrinfo5
  /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored from cffi callback <function _addrinfo_cb at 0x7fca20582ee0>: None

  Traceback (most recent call last):
    File "/home/tkloczko/rpmbuild/BUILDROOT/python-pycares-4.2.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages/pycares/__init__.py", line 162, in _addrinfo_cb
      result = ares_addrinfo_result(res)
    File "/home/tkloczko/rpmbuild/BUILDROOT/python-pycares-4.2.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages/pycares/__init__.py", line 841, in __init__
      cname_ptr = ares_addrinfo.cnames
  ffi.error: struct ares_addrinfo: wrong total size (cdef says 16, but C compiler says 24). fix it or use "...;" as the last field in the cdef for struct ares_addrinfo to make it flexible

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/tests.py:430: ANY type does not work on Mac.
SKIPPED [1] tests/tests.py:537: The site used for this test no longer returns a non-ascii SOA.
XFAIL tests/tests.py::DNSTest::test_getnameinfo_ipv6
  reason:
XFAIL tests/tests.py::DNSTest::test_getnameinfo_ipv6_ll
  reason:
XFAIL tests/tests.py::DNSTest::test_query_txt_bytes2
  reason:
XFAIL tests/tests.py::DNSTest::test_query_txt_multiple_chunked_with_non_ascii_content
  reason:
FAILED tests/tests.py::DNSTest::test_getaddrinfo - AssertionError: <class 'NoneType'> != <class 'pycares.ares_addrinfo_result'>
FAILED tests/tests.py::DNSTest::test_getaddrinfo2 - AssertionError: <class 'NoneType'> != <class 'pycares.ares_addrinfo_result'>
FAILED tests/tests.py::DNSTest::test_getaddrinfo3 - AssertionError: <class 'NoneType'> != <class 'pycares.ares_addrinfo_result'>
FAILED tests/tests.py::DNSTest::test_getaddrinfo4 - AssertionError: <class 'NoneType'> != <class 'pycares.ares_addrinfo_result'>
FAILED tests/tests.py::DNSTest::test_getaddrinfo5 - AssertionError: <class 'NoneType'> != <class 'pycares.ares_addrinfo_result'>
===================================================== 5 failed, 43 passed, 2 skipped, 4 xfailed, 5 warnings in 24.59s ======================================================

There are some warnings which could be used to improve test suite.

from pycares.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.