Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-18827

Fix pytest deprecations in cqlsh tests

    XMLWordPrintableJSON

Details

    Description

      Pytest reports several warnings regarding deprecated packages or methods:

       

       
      ../../../../../usr/local/lib/python3.10/site-packages/eventlet/support/greenlets.py:6
        /usr/local/lib/python3.10/site-packages/eventlet/support/greenlets.py:6: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
          preserves_excinfo = (distutils.version.LooseVersion(greenlet.__version__)
       
      ../../../../../usr/local/lib/python3.10/site-packages/eventlet/support/greenlets.py:7
        /usr/local/lib/python3.10/site-packages/eventlet/support/greenlets.py:7: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
          >= distutils.version.LooseVersion('0.3.2'))
       
      ../../../../../usr/local/lib/python3.10/site-packages/cassandra/io/asyncorereactor.py:34
        /usr/local/lib/python3.10/site-packages/cassandra/io/asyncorereactor.py:34: DeprecationWarning: The asyncore module is deprecated and will be removed in Python 3.12. The recommended replacement is asyncio
          import asyncore
       
      cqlshlib/test/test_copyutil.py: 42 warnings
        /Users/brad/Cassandra/cassandra/pylib/cqlshlib/copyutil.py:147: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead
          feeding_thread.setDaemon(True)
       
      cqlshlib/test/test_cqlsh_completion.py::testrun_cqlsh
        /usr/local/lib/python3.10/site-packages/_pytest/python.py:198: PytestReturnNotNoneWarning: Expected None, but cqlshlib/test/test_cqlsh_completion.py::testrun_cqlsh returned <contextlib.closing object at 0x126dbc460>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
          warnings.warn(
       
      cqlshlib/test/test_cqlsh_output.py::testcall_cqlsh
        /usr/local/lib/python3.10/site-packages/_pytest/python.py:198: PytestReturnNotNoneWarning: Expected None, but cqlshlib/test/test_cqlsh_output.py::testcall_cqlsh returned ('\nNotice: Credentials in the cqlshrc file is deprecated and will be ignored in the future.\nPlease use a credentials file to specify the username and password.\n\nWARNING: cqlsh was built against 5.1, but this server is 4.1..  All features may not work!\n', 0), which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
          warnings.warn(
       
      cqlshlib/test/test_cqlsh_output.py::testrun_cqlsh
        /usr/local/lib/python3.10/site-packages/_pytest/python.py:198: PytestReturnNotNoneWarning: Expected None, but cqlshlib/test/test_cqlsh_output.py::testrun_cqlsh returned <contextlib.closing object at 0x12710c520>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
          warnings.warn(
       
      cqlshlib/test/test_unicode.py::testrun_cqlsh
        /usr/local/lib/python3.10/site-packages/_pytest/python.py:198: PytestReturnNotNoneWarning: Expected None, but cqlshlib/test/test_unicode.py::testrun_cqlsh returned <contextlib.closing object at 0x126c93700>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
          warnings.warn(
      

       

      Resolution:

      Out of scope:

      • DeprecationWarning: distutils Version from greenlets.py appears to be eventlet issue #763
      • DeprecationWarning: The asyncore module from asyncorereactor.py appears to come from the eventlet issue #804

      Attachments

        Activity

          People

            bschoeni Brad Schoening
            bschoeni Brad Schoening
            Brad Schoening
            Brandon Williams, Stefan Miklosovic
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m