Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain how to test iface in PyQGIS testing framework #3776

Open
DelazJ opened this issue Jun 2, 2019 · 2 comments
Open

Explain how to test iface in PyQGIS testing framework #3776

DelazJ opened this issue Jun 2, 2019 · 2 comments

Comments

@DelazJ
Copy link
Collaborator

DelazJ commented Jun 2, 2019

Description

As per #3621 (comment)
One question.
How can I make it detect iface, without generating a standlone application or my own iface?

from qgis.utils import iface

  iface.mapCanvas().layers()
Exception raised:
  Traceback (most recent call last):
    File "/usr/lib/python3.6/doctest.py", line 1330, in __run
      compileflags, 1), test.globs)
    File "<doctest default[0]>", line 3, in <module>
      iface.mapCanvas().layers()
  AttributeError: 'NoneType' object has no attribute 'mapCanvas'

and processing too:

ModuleNotFoundError: No module named 'processing'

Currently code samples making these calls are made untested, hence potentially not reliable in the long run

@All4Gis
Copy link
Contributor

All4Gis commented Jul 23, 2019

Any updates on this @DelazJ ?

@DelazJ
Copy link
Collaborator Author

DelazJ commented Jul 23, 2019

Euhhh... Unfortunately, none!
I don't have the necessary background to look into this issue so nothing would come from me. Since this is an issue we'll face if we want to have the testing infrastructure fully operational, the report was to attract skilled people. But seems that it fails...
Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants