Skip to content

ci: Fixes few warnings and failure

Valentin Valls requested to merge check-test-warnings into master

Fixes warnings displayed by pytest

Plus a fix on test_retry_interrupted_scans happening time to time: see https://gitlab.esrf.fr/bliss/bliss/-/jobs/924278

tests/test_counters.py::test_tango_attr_counter
  /opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/scanning/acquisition/counter.py:430: RuntimeWarning: All-NaN axis encountered
    Min = numpy.nanmin((Min, newValue))
tests/test_counters.py::test_tango_attr_counter
  /opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/scanning/acquisition/counter.py:431: RuntimeWarning: All-NaN axis encountered
    Max = numpy.nanmax((Max, newValue))
tests/shell/test_getval.py::test_getval_yes_no_keyboardinterrupt
tests/shell/test_getval.py::test_getval_int_range[data0]
tests/shell/test_getval.py::test_getval_int_too_big
tests/shell/test_getval.py::test_getval_idx_list
  /opt/conda/envs/default_env/lib/python3.9/site-packages/_pytest/logging.py:375: RuntimeWarning: coroutine 'Application._handle_exception.<locals>.in_term' was never awaited
    self.records = []
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
tests/tango/test_tango_device.py::test_deviceproxy_release
  /opt/conda/envs/default_env/lib/python3.9/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <coroutine object Application.run_async at 0x7f164091ee40>
  
  Traceback (most recent call last):
    File "/opt/conda/envs/default_env/lib/python3.9/site-packages/prompt_toolkit/application/application.py", line 886, in run_async
      return await _run_async(f)
  GeneratorExit
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/shell/prompt_toolkit_patch.py", line 30, in run_async
      return await super().run_async(**kwargs)
    File "/opt/conda/envs/default_env/lib/python3.9/site-packages/prompt_toolkit/application/application.py", line 892, in run_async
      await self.cancel_and_wait_for_background_tasks()
    File "/opt/conda/envs/default_env/lib/python3.9/site-packages/prompt_toolkit/application/application.py", line 1189, in cancel_and_wait_for_background_tasks
      task.cancel()
    File "/opt/conda/envs/default_env/lib/python3.9/site-packages/bliss/common/greenlet_utils/asyncio_gevent.py", line 33, in call_soon
      handle = super(EventLoop, self).call_soon(callback, *args, **kwargs)
    File "/opt/conda/envs/default_env/lib/python3.9/asyncio/base_events.py", line 751, in call_soon
      self._check_closed()
    File "/opt/conda/envs/default_env/lib/python3.9/asyncio/base_events.py", line 515, in _check_closed
      raise RuntimeError('Event loop is closed')
  RuntimeError: Event loop is closed
  
    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
Task was destroyed but it is pending!
task: <Task pending name='Task-4755' coro=<Application._start_auto_refresh_task.<locals>.auto_refresh() running at /opt/conda/envs/default_env/lib/python3.9/site-packages/prompt_toolkit/application/application.py:554> wait_for=<Future cancelled> cb=[Application._on_background_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name='Task-4756' coro=<Application._poll_output_size() running at /opt/conda/envs/default_env/lib/python3.9/site-packages/prompt_toolkit/application/application.py:1226> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f1646437b20>()]> cb=[Application._on_background_task_done()]>

Merge request reports