-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add test for API Python snippets #9615
Conversation
f7fe620
to
73af98f
Compare
@@ -18,6 +18,9 @@ for highlighting features or geometries on a map canvas. | |||
|
|||
.. code-block:: python | |||
|
|||
mapCanvas = iface.mapCanvas() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to move this bit to a "setup" section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running them, snippets come directly from compiled Python API docstrings (.so), so i don't want to put setup section in the docstring, because it is readable by IDE and more.
I would prefer move this specific line to the python test file 'test_docstrings.py" and mapCanvas would be passed as a global variable like iface.
This is great work, will be VERY useful! |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
is it a an approve? IMHO the test works if there are really snippets in docstrings of qgis._core and qgis._gui modules. Are there already available @arnaud-morvan ? |
Yes, the test execute snippets from docstrings in qgis._core and qgis._gui modules (after compilation). |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist. |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist. |
Description
Add unittest.TestCase that use native python doctest module with custom parser to test API Python snippets.
In this PR, only QgsHighlight is tested, more classes might be tested later using INCLUDE variable.
Checklist
fixes #11111
in the commit message next to the description[FEATURE]
in the commit message[needs-docs]
in the commit message and contain sufficient information in the commit message to be documentedscripts/prepare-commit.sh
script before each commit