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

Configurable options and visual map #5

Merged
merged 13 commits into from
Nov 25, 2021
Merged

Configurable options and visual map #5

merged 13 commits into from
Nov 25, 2021

Conversation

Joonalai
Copy link
Contributor

@Joonalai Joonalai commented Nov 22, 2021

This PR:

  • Adds configurable options:
    • qgis_qui_enabled to enable or disable GUI using QT_QPA_PLATFORM environment variable
      • qgis_disable_gui command line option can be used to override
    • qgis_canvas_width and qgis_canvas_height
    • qgis_disable_init command line option to prevent QGIS application from initializing (this is used mainly to make test_ini_* tests work.
  • Marker qgis_show_map to enable visual inspections of the QGIS map with all the datasets. This currently has few "bugs":
    • If some layers have different CRS than the project, they are not visible -> this is handled by reprojecting all those layers
    • Layer order cannot be managed in any way (except removing all layer and adding them again in certain order) which affects especially reprojected layers
  • Decorator clean_qgis_layer which can be used with QgsMapLayer fixtures to ensure that they are cleaned properly if they are used but not added to the QgsProject. This is only needed with layers with other than memory provider.
  • Fixture qgis_version to show current QGIS version as integer (eq. 3.10 == 31000).

@Joonalai Joonalai force-pushed the configurable-map branch 3 times, most recently from 785ab9d to fe9f2ca Compare November 22, 2021 14:07
@LKajan
Copy link
Contributor

LKajan commented Nov 22, 2021

Maybe not related to this PR but when trying to run tests I got an ImportError from pytest that atomicwrites was not found. That is a new pytest dependency that somewhy was not installed in my venv. I created a separate PR to update the dependencies: #6.

@LKajan
Copy link
Contributor

LKajan commented Nov 22, 2021

Could you wrap the usage of db.gpkg to a fixture that creates a copy of it before passing it to tests. Now when running tests and accessing the geopackage it gets modified and git wants therefore add changes to the index.

@Joonalai
Copy link
Contributor Author

@LKajan maybe we should leave the pip-tools part of the pre-commit out of CI?

@LKajan
Copy link
Contributor

LKajan commented Nov 23, 2021

@LKajan maybe we should leave the pip-tools part of the pre-commit out of CI?

Yes, it looks to be better so. Now generated dependencies are so different on different platforms.

Copy link
Contributor

@LKajan LKajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure I followed everything here but I think it is ok to merge.
I'm a bit concerned that the map part of the code got so complex and there might be bugs and issues in that code and therefore the maps are not what those are supposed to be.
I would be also ok if those maps would be just saved on a disk after the test and not popped up as a dialog.

src/pytest_qgis/pytest_qgis.py Outdated Show resolved Hide resolved
src/pytest_qgis/pytest_qgis.py Outdated Show resolved Hide resolved
src/pytest_qgis/pytest_qgis.py Outdated Show resolved Hide resolved
@Joonalai Joonalai merged commit d17f9f7 into main Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants