94 Commits

Author SHA1 Message Date
Jean Felder
ab827c123d testing: Ignore swig deprecation warnings
With recent versions of Python + unittest + swig (like the ones from
fedora 42), `PyQgsProcessExecutablePt1` and
`PyQgsProcessExecutablePt2` unit test fail because of some deprecation
warning message coming from Swig.

This issue will be fixed in Swig 4.4. In the meantime, ignore them.

See: https://github.com/swig/swig/issues/2881
2025-05-29 08:47:21 +10:00
Nyall Dawson
38be0a3d98 De-duplicate code, remove dead code 2025-02-12 06:33:14 +10:00
Nyall Dawson
05c269d61d Fix test on newer GEOS versions 2024-12-14 10:22:12 +10:00
Nyall Dawson
7dbd894c8e
Ignore LC_ALL: cannot change locale when testing std output 2024-12-12 17:47:43 +10:00
Even Rouault
5665665712 Fix CMake 3.31 warnings 2024-12-04 06:50:16 +10:00
Denis Rouzaud
0f032e5f2d run pre-commit on all files 2024-11-29 15:38:02 +01:00
Nyall Dawson
f2b84709fa Add test for parentQuantityName 2024-05-14 12:00:10 +10:00
Nyall Dawson
4931f8ebe4 Gracefully handle NULL/not-NULL comparisons in QgisTestCase.checkLayersEqual
We always want NULL values sorted first, and never want to try
to directly compare NULL/not NULL values.

Doing so raises an exception on the PyQt6 builds, where NULL === None
and comparisons between None and not-None values are prohibited
in Python
2024-02-12 16:44:06 +10:00
Nyall Dawson
4aeecb4c42 Add QgsWebEnginePage::render( QPainter* ) method
Requires a PDF4Qt enabled build. This method exports the QWebEnginePage
to a PDF file, so that we get nicely vectorised objects and
text-as-text. It's the ONLY supported way in Qt API to do this, every
other method of rendering QWebEnginePage forces rasterisation of
the content.

We then use the QgsPdfRenderer class to render the temporary PDF
content to a QPainter device, which keeps vector objects as vectors.
2024-02-12 12:48:27 +10:00
Nyall Dawson
bf4bd47419 Use standard render test reporting mechanism in server tests 2024-02-06 18:59:03 +10:00
Nyall Dawson
cf8cf74331 Use standard test base methods for pal tests
Ensures that we get these tests included in the reports
2024-02-04 08:57:15 +10:00
Nyall Dawson
169f4e1b85 Update most python tests to use base class render check methods 2024-01-23 16:25:52 +01:00
Nyall Dawson
8eb8d612b3 Modernize some tests 2024-01-23 09:01:55 +10:00
Nyall Dawson
c16a1e2b3d Update enums 2024-01-19 19:44:48 +10:00
Nyall Dawson
6cf940c20d Update tests to newer methods 2023-12-06 06:39:49 +10:00
Nyall Dawson
38557ab991 Lint 2023-11-27 14:23:18 +10:00
Nyall Dawson
74dfe786e9 Include details of failing render test callers from Python tests 2023-11-27 14:23:18 +10:00
Nyall Dawson
e494d1a335 Generate markdown report from Python tests too 2023-11-22 05:44:58 +10:00
Juergen E. Fischer
3dac2dc95c put test_data_dir.py into build directory (don't use install directory
prior to install)
2023-10-15 15:56:31 +02:00
Nyall Dawson
3b85d07f08 Fix flake 2023-10-11 11:36:40 +10:00
Nyall Dawson
d3d1dfde36 Write test report header when run from Python 2023-10-11 11:36:40 +10:00
Nyall Dawson
bc960c5ffa Make TEST_DATA_DIR accessible from python tests 2023-10-11 11:36:40 +10:00
Nyall Dawson
b552c155a8 Use base class render check methods in more tests, avoids
tests which pollute test failure report with unnecessary noise
2023-10-06 16:00:31 +10:00
Nyall Dawson
325a5cb16a Fix lint 2023-07-07 14:29:28 +10:00
Nyall Dawson
394315955e Apply suggestions from code review 2023-07-07 14:29:28 +10:00
Matthias Kuhn
1626b7e928 Move tests to QgisUnitTests 2023-07-07 14:29:28 +10:00
Matthias Kuhn
54b45078b5 Monkey patch and deprecate API 2023-07-07 14:29:28 +10:00
Nyall Dawson
1a1d2a7a8d Alternative approach to a QGIS specific unittest class 2023-07-07 14:29:28 +10:00
Nyall Dawson
0811919ba6 Ensure symbols using map unit sizing work correctly in elevation
profile plots

Fixes #52833
2023-05-23 09:56:46 +10:00
Matthias Kuhn
c8dd71e4d3 Set size for layout check 2023-05-13 08:47:22 +02:00
Matthias Kuhn
da075fa259 Use QgsLayoutChecker from core 2023-05-09 14:41:31 +02:00
Nyall Dawson
60380c1cf8 Use fstring 2023-04-27 04:39:14 +10:00
Nyall Dawson
3492ddbcfa Move layout checking to base class 2023-04-27 04:39:14 +10:00
Nyall Dawson
e2ad92e843 Only append to existing test reports if running under CI 2023-04-27 04:39:14 +10:00
Nyall Dawson
ecab2bfb4f Partially update annotation item test to newer framework 2023-04-27 04:39:14 +10:00
Nyall Dawson
f2878a43e1 Start moving some render check methods to base class 2023-04-27 04:39:14 +10:00
Sandro Santilli
7588ce429f Cleanup temporary python test config path when requested
References #48884
2022-10-20 04:49:56 +02:00
Nyall Dawson
9f07b782f2 More working processing tests on newer systems 2022-08-10 16:33:18 +10:00
Nyall Dawson
b17ad2f703 Add some more methods to normalize geometries for processing tests 2022-08-08 17:50:06 +10:00
Nyall Dawson
07ee0bb7e4 Fix some tests on newer GEOS 2022-03-17 18:12:27 +10:00
Denis Rouzaud
da08c8a435
[cmake] generalize Python output directory in UseTest macro (#43191)
* [cmake] generalize Python output directory in UseTest macro

this is helpful in case we set up another python output directory (eg PySide2)

* define python output directories to the parent scope

* try with target_include_directories

* define vars on top level

* Update UsePythonTest.cmake

* some cleanup

* more cleanup

* fix uic

* fix path for all platforms

* fix var
2021-05-13 07:32:03 +02:00
Etienne Trimaille
3711fcf198 Update the flake8 configuration 2021-05-09 16:40:38 +10:00
Denis Rouzaud
555f516925
use cmake native FindPython (#42497) 2021-03-28 21:49:40 +02:00
Nyall Dawson
973682baa3 Use QgsRenderChecker to compare png images when comparing processing result
directories
2021-02-08 13:23:40 +10:00
Nyall Dawson
1af083415a Use a different technique to compare expected vs result directories in processing tests, which allows us to compare the
contents of files using a more flexible approach
2021-02-08 13:23:40 +10:00
Nyall Dawson
d4f2b842ba Allow for multiple reference text files 2021-02-08 13:23:40 +10:00
Nyall Dawson
9ba0bd9944 Allow casting date/datetime values to string to compare to expected results 2021-02-08 13:23:39 +10:00
Nyall Dawson
846d1fe0e6 [processing] Add option to ignore part order when comparing geometries to expected results 2021-02-08 13:23:39 +10:00
Nyall Dawson
7478bca68d [processing] Don't use authid to compare layer CRSes
Instead of QgsCoordinateReferenceSystem == operator, so that we
can correctly test equality of non-standard CRSes
2021-01-11 13:06:05 +10:00
Denis Rouzaud
eddf6feb45 modernize CMakeLists.txt files 2020-11-12 07:14:46 +10:00