Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-2700

Prevent "Comparison between bytes and string" warning

    XMLWordPrintable

    Details

    • Type: Clean up
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.2.0
    • Fix Version/s: 5.2.2
    • Component/s: Framework

      Description

      Error not raised on Github Actions but on my local machine

      _________________ ERROR at teardown of test_token_management __________________
      
      recwarn = WarningsRecorder(record=True)
      
          @pytest.fixture(autouse=True)
          def no_warnings(recwarn):
              """Fail on warning."""
          
              yield
          
              warnings = []
              for warning in recwarn:  # pragma: no cover
                  message = str(warning.message)
          
                  if "sentry_sdk" in warning.filename:
                      continue
                  elif "WaitForInputIdle" in message:
                      # Happen while testing the integration on Windows, we can skip it:
                      # "Application is not loaded correctly (WaitForInputIdle failed)"
                      continue
                  elif "type=SocketKind.SOCK_STREAM" in message:
                      # Socket leaks on macOS, may need investigations
                      continue
                  elif "TerminalReporter.writer attribute is deprecated" in message:
                      # Cannot understand if this is from our code or a pytest plugin,
                      # let's wait for when it will fail :)
                      continue
                  elif "(rm_rf) error removing" in message:
                      # First appeared with pytest 5.4.1
                      continue
          
                  warn = f"{warning.filename}:{warning.lineno} {message}"
                  print(warn, file=sys.stderr)
                  warnings.append(warn)
          
      >       assert not warnings
      E       AssertionError: assert not ['C:\\Users\\rgrasland\\PycharmProjects\\nuxeo-drive\\nxdrive\\engine\\engine.py:938 Comparison between bytes and string']
      
      message    = 'Comparison between bytes and string'
      recwarn    = WarningsRecorder(record=True)
      warn       = 'C:\\Users\\rgrasland\\PycharmProjects\\nuxeo-drive\\nxdrive\\engine\\engine.py:938 Comparison between bytes and string'
      warning    = <warnings.WarningMessage object at 0x05D2E310>
      warnings   = ['C:\\Users\\rgrasland\\PycharmProjects\\nuxeo-drive\\nxdrive\\engine\\engine.py:938 Comparison between bytes and string']
      
      tests\conftest.py:88: AssertionError
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 15 minutes
                  15m