Skip to content

tests: resolve some uncaught warnings in the test suite

James Henstridge requested to merge jamesh/pygobject:fix-test-warnings into main

This MR fixes a few warnings being generated by the test suite:

  • Use of various gi._options types in tests/test_options.py.
  • tests/test_override_gdkpixbuf.py letting a warning escape from its test. I've changed it to test for both warnings from a single call with patterns that don't overlap.
  • pytest_runtest_call in tests/conftest.py was raising exceptions, which apparently hooks aren't supposed to do.
  • Silence the os.fork warnings in tests/test_mainloop.py. I haven't used assertWarns here because the warning is only emitted in the parent process and not the child.

I also set stacklevel on a few of the warnings so they report the call site rather than the deprecated function itself.

Edited by James Henstridge

Merge request reports

Loading