Skip to content

Demonstrate usage with pytest #3

Description

@jmcgeheeiv

Commenter Charlotte Godley raised this issue in the comments of deprecated blog article https://johnnado.com/pyqt-qtest-example/. In their response, Tord added links to the pytest plugin that would be used for this.

This needs to be implemented:

  • Demonstrate running PyQt tests under pytest in the example code
  • Add a brief explanation of running PyQt tests under pytest in README.md

Charlotte Godley

October 16, 2016 @ 4:30 pm

Hey,
Re other people’s comments about unittest and pyqt, I found it much easier to fix these issues using pytest because you can scope your fixtures. Means you have to move to a whole different way of working though (injecting fixtures using parameters rather than class values).

Other thing I’m trying to work on right now is testing actions and menus, which are different because you apparently can’t use mouseClick for actions. You wouldn’t happen to know anything about that would you?

Tord replied

September 26, 2017 @ 11:47 am

Just for reference for those finding this article (thank you John for writing it), the plugin for pytest used for running tests for PyQt is called pytest-qt:

Kind Regards, Tord

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions