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

Fix test_file_action_with_values() to finish the action

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.1.4
    • Fix Version/s: 5.1.0
    • Component/s: Tests

      Description

      test_file_action_with_values() is leaking its action and it is making test_tooltip() to fail on macOS:

      [gw1] darwin -- Python 3.9.2 /Users/runner/work/nuxeo-drive/nuxeo-drive/.tox/base/bin/python
      
          def test_tooltip():
              @tooltip("Testing tooltip!")
              def function(a, b=1):
                  # There should be 1 action, automatically created by the decorator
                  action = Action.get_current_action()
                  assert action
                  assert action.type == "Testing tooltip!"
          
                  return a * b
          
              # There is no Action right now
      >       assert Action.get_current_action() is None
      E       AssertionError: assert Mocking('test.odt'[42]-100.0) is None
      E        +  where Mocking('test.odt'[42]-100.0) = <function Action.get_current_action at 0x108e51f70>()
      E        +    where <function Action.get_current_action at 0x108e51f70> = Action.get_current_action
      
      function   = <function tooltip.<locals>.action_decorator.<locals>.func_wrapper at 0x109580a60>
      
      tests/unit/test_action.py:203: 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 - 1 hour
                  1h