Can I use QTest or Qt Quick test on PySide2 or PySide6
-
Hello, is it possible to use QTest or Qt Quick Test with PySide2 or PySide6?
The documentation does not recommend using it for unit tests.
https://doc.qt.io/qtforpython-6/PySide6/QtTest/index.htmlIs anyone using PySide2? Can you share an example URL?
Which one is the more commonly used convention - pytest-qt or QtTest?
I think using pytest-qt is common convention.
Pytest is a testing framework that uses function-based tests, which helps minimize code usage and is practical. However, I tend to prefer Qt's solutions for testing.
I am a bit confused because while the documentation recommends using pytest, I am not sure if I should go with pytest-qt.
Additionally, I am curious if Qt-creator will support pytest in the future.
-
Hi,
pytest-qt is a good option. It works pretty well so go with it.
-
Thanks for your answer, @SGaist.
I appreciate your insight.Do you know what Qt's future strategy is?
Is there any plan to offer pytest support on the Qt Creator IDE?
What strategy are you referring to ?
What kind of support would you expect in Qt Creator ?
-
@SGaist
To view test results, click Tools, then Tests, and select Run All Tests.To create a unit test, click New File and Test Case.
It would be beneficial to have these types of features available for pytest.
-
@CKurdu that's the kind of things you should ask as features on the bug tracker.
Note that pytest tests have nothing really special in their structure with regards to Python's official test module.