58 Commits

Author SHA1 Message Date
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
Denis Rouzaud
7d1ca81618
improve geometry equality report in tests (#39772)
from https://github.com/qgis/QGIS/pull/8154/files#diff-dbb55b6871a9157f22dc7a979009676cb03f2fadefc557ad0e66a47c92a93503
2020-11-03 09:30:14 +01:00
Alexander Bruy
136c5a4bc2 perform rounding either if field type is numeric or if value was casted
to the number
2020-06-16 08:35:51 +10:00
Sandro Santilli
c23a19793a Set QGIS_CUSTOM_CONFIG_PATH to temporary dir for python tests
Partially fixes #34185
See also #34187
2020-02-03 09:28:38 +01:00
Bas Couwenberg
2628c480c5 Don't include revision in sources.
Prevent changes to files that weren't changed between releases.
This eases review of the changes between releases significantly.
2019-05-17 16:47:47 +02:00
Martin Dobias
ee63cffd88 [processing] Add 'project' to test definition and 'directory' output test
- for algorithms that produce directory output, it is possible to test
  that directory contents are exactly the same (recursively)
- added possibility to have a project file loaded before an algorithm is run
- documented the new additions (+ few existing ones)
2019-04-25 21:40:31 +02:00
Alessandro Pasotti
ed9709b4fa Copy updated test runner into the docker
Handle -e and do not exit on error
2018-11-20 10:31:05 +01:00
Matthias Kuhn
8aca375a6e Add assertGeometriesEqual function for testing 2018-08-21 17:57:14 +02:00
Martin Dobias
c3279ee544 Add a note about version added for new functions in testing module 2018-05-10 14:10:10 -04:00
Martin Dobias
ef145afca6 Add support for unordered comparison of features of layers
This is useful when an algorithm returns features in no particular order
and sorting features by attributes does not help because there may be
features with the same attributes, giving non-unique sorting orders.
2018-05-10 06:50:57 -04:00
Martin Dobias
73d10afe31 Processing tests: allow topological geometry tests instead of exact tests
This is useful with geometry algorithms when the order of the coordinates of produced
geometries does not need to be exactly the same every time, but the output is still
topologically equivalent.
2018-05-10 06:50:57 -04:00
Nyall Dawson
739d4fab09 More verbose test outputs 2018-05-06 19:19:45 +10:00
Matthias Kuhn
7b3308dc4a Improved debug output on test fail 2018-05-02 16:11:08 +02:00
Matthias Kuhn
5f0f8062bc Compare case insensitive 2018-05-02 14:17:59 +02:00
Matthias Kuhn
d9bdedf6d5 testing.checkLayersEqual, assert field names 2018-05-02 11:44:14 +02:00
Nyall Dawson
6dbdbead0c Handle null values in processing attribute tests 2017-11-14 07:14:46 +10:00
Matthias Kuhn
394c53154f Update for nose2 0.7.0 2017-11-05 23:03:16 +01:00
Nyall Dawson
837c1c56eb Fix tests 2017-10-26 08:44:38 +10:00
Nyall Dawson
e9fd409552 Allow multiple primary key fields to be specified for processing tests
`
2017-09-08 16:33:55 +10:00
Nyall Dawson
b87b2fe827 Allow skipping crs check in processing test results
The GML format often requires extra 'hand holding' in order to
get QGIS to detect it's CRS (e.g. GML files created directly
in GDAL will not have an autodetected CRS when pulled into
QGIS). This needs fixing, but as a workaround to allow
processing algorithm porting to continue we can now skip
the crs check for these layers.
2017-08-14 04:56:24 +10:00
Matthias Kuhn
abf768141b More verbose python testing output 2017-08-10 08:03:50 +02:00
Mario Baranzini
78af413dcc Remove python future compatibility layer 2017-08-07 10:27:15 +02:00
Nyall Dawson
d4ad063f45 Allow specifying a 'primary key' field when comparing layers for
processing tests

Some algorithms will return results in different orders, e.g.
due to the use of dicts or other methods which do not guarantee
a fixed return order.

Using a primary key to do the feature match allows us to flexibly
handle these situations and provide tests for these algorithms.
2017-08-05 22:10:18 +10:00
Nyall Dawson
e8d667cac3 Allow testing of layer equality without throwing asserts
Sometimes in tests it's required to check for layer equality without
aborting in case of mismatches
2017-08-05 17:51:38 +10:00
Juergen E. Fischer
c77172ed3d fix more flake8 warnings 2017-03-05 10:21:24 +01:00
Matthias Kuhn
eb7a235dc1 Print messages from QgsMessageLog to the console when testing 2017-01-19 14:41:04 +01:00
Nyall Dawson
1bdb35d630 Avoid key error on fields which should be skipped 2016-12-07 20:13:29 +10:00
Denis Rouzaud
a373f95707 [FEATURE] add functionnality to copy/move feature to move feature map tool 2016-11-15 11:28:47 +01:00
Nyall Dawson
143c18da6f Fix processing tests weren't actually comparing resultant features
.... oops (my fault - copy/paste error)
2016-11-07 09:23:35 +10:00
Juergen E. Fischer
31df84aa6b run 2to3 on source 2016-09-21 23:30:04 +02:00
Nyall Dawson
f449bf2361 Make test layer comparison handle different order of features 2016-08-02 11:53:11 +10:00
Nyall Dawson
bd7d913379 Refine QgsFeature geometry getters/setters
All pointer based methods have been removed.

Now we have only:

  void setGeometry( const QgsGeometry& geom )

and

  QgsGeometry geometry() const

Benefits include avoiding a whole lot of tricky pointer lifetime
issues, potential memory leaks, and finally closing #777, which
has survived for over 9 years!...

Impacts on PyQGIS code:
- no more need for the messy
  g = QgsGeometry( feature.geometry() )
  workaround, just use g = feature.geometry() instead
- IMPORTANT: you can no longer test whether a feature has geometry
 using `if f.geometry():`, since QgsFeature::geometry() will
 *always* return an object. Instead, use
 `if not f.geometry().isEmpty():`, or preferably the new method
 `if not f.hasGeometry():`

Fix #777
2016-08-01 16:25:46 +10:00
Matthias Kuhn
c1687abc80 Replace calls to deprecated assertEquals method 2016-05-03 09:18:27 +02:00
Denis Rouzaud
8071acd064 move PyQt compat folder to python/qgis 2016-04-29 14:10:26 +02:00
Denis Rouzaud
ba94896015 fix python testing install directory 2016-04-21 13:54:11 +02:00
Matthias Kuhn
816c322df5 Workaround for buggy mac osx cleanup 2016-04-15 09:20:41 +02:00
Matthias Kuhn
709d3cedd0 Cleanup test application on exit 2016-04-14 12:15:11 +02:00