Commit Graph

123 Commits

Author SHA1 Message Date
Ogi Moore
4d388ee633 Use open context-manager instead of file.open()
Static code checker identified multiple places where a file is opened
but is not necessarily closed.  This commit addressed that with the
exception of RemoteGraphicsView.py
2021-04-25 17:05:05 -07:00
Ogi Moore
5c67f03b0e skip test without generating warning 2021-04-15 21:02:49 -07:00
Martin Chase
6fed6d42b3
Protect makeARGB with tests and benchmarks (#1697)
* update to working

* cupy tests, too

* doubling up and down

* add more realism to the benchmarks

* name to reflect scale

* use different numbers to mean different numbers

(that sure does sound tautological)

* more sensible: order, error

* thorough check of lots of makeARGB arg combos

* docstring for tool usage

* no print needed

* better error messages

* test makeARGB using cupy, too

* skip without cupy available

* switch from conda to venv

* skip cupy runs when not available

* use endian-proof makeARGB shim in tests

* generate the asv conf to suit the system

* document running asv

* comments for future matrix goals

* put all makeARGB tests together; name for clarity

* subprocess.check_output is standard for all supported pythons

* better handle lack of git version

* use makeARGB shim

* small fixes and improvements
2021-04-15 15:51:21 -07:00
KIU Shueng Chuan
02a48afc60 test_makeARGB() : normalize to B,G,R,A 2021-04-01 08:38:10 +08:00
KIU Shueng Chuan
179b27ad8c image_testing.py: swap red and blue channels 2021-04-01 08:32:31 +08:00
Ogi Moore
6c5c0b590f Skip test_reload on python 3.10+ 2021-02-13 10:57:38 -08:00
Ogi Moore
3bfe2d81ba Do not use numpy deprecated type aliases 2021-02-13 10:57:38 -08:00
Ogi Moore
fc550aab86 keep testing deprecated objects, catch warnings 2021-02-12 13:08:00 -08:00
KIU Shueng Chuan
659392d4bb don't rely on QImage being non-const
the previous formulation creates an ndarray and then creates an QImage
over it w/o copying. this relies on the QImage thus created being
non-const.

if the QImage was (unintentionally) created as const, the subsequent
QPainter render on the const QImage would trigger a COW. i.e. the
original underlying ndarray wouldn't be updated.

this is only an issue for PyQt bindings where const QImages can be
created.
2021-02-11 10:38:19 +08:00
KIU Shueng Chuan
c85c62deda getargspec -> getfullargspec
former is deprecated since Python 3.0
2021-02-06 17:08:32 +08:00
pijyoi
cd914495ec
get test_ref_cycles to pass (#1539)
* get test_ref_cycles to pass

let objects die without gc.collect()
if you don't have cyclic references, there should be no need to call
gc.collect()

the usage of gc.collect() was causing pytest running with coverage to
crash on Python 3.7 / PySide2 5.12 / {Linux, Windows}.

* remove imports used only by the removed code
2021-02-04 20:18:53 -08:00
Ogi Moore
f336ac2d91
Merge pull request #1541 from pijyoi/remove_qt4_qtest_shim
use qWaitForWindowExposed instead of qWaitForWindowShown
2021-02-04 16:15:39 -08:00
KIU Shueng Chuan
711dcd4d5a use qWaitForWindowExposed instead of qWaitForWindowShown
qWaitForWindowShown has been obsolete since Qt 5.6
2021-02-04 11:35:19 +08:00
Kenneth Lyons
cd10719837 Support siPrefix with no suffix in SpinBox 2021-02-03 17:14:06 -08:00
KIU Shueng Chuan
6b7afbf75c remove six module 2021-01-29 16:13:27 +08:00
KIU Shueng Chuan
6c760f3de1 add PyQt6 to CI
skip tests that don't work for Qt6

add Qt6 and remove Qt4 from test_examples.py

update README.md

switch mouse tests to use QPointF

this eliminates all the special casing for different bindings
2021-01-23 08:31:00 +08:00
Ogi Moore
b3a0051a99 Use os.getenv, not os.environ 2021-01-19 23:23:24 -08:00
Torsten Sommer
510626c15f
Add NonUniformImage, example and tests. (#509)
* Add NonUniformImage, example and tests.

* Use updated test-data tag

* Fix line ending, remove lut.setLevels keyword arguments call

Co-authored-by: Ogi <ognyan.moore@gmail.com>
2021-01-19 21:43:58 -08:00
Ogi Moore
78bc0fd3ca
Merge pull request #1495 from pijyoi/future_compat
some fixes for PySide6 future compatibility
2021-01-19 21:05:50 -08:00
Ogi Moore
ee623c0fa9 Get testdata using checkout action 2021-01-19 20:20:19 -08:00
KIU Shueng Chuan
9f54baed0c test_reload.py: skip for PySide6 and Python 3.9 2021-01-16 14:37:21 +08:00
KIU Shueng Chuan
d0a7ceea2d relax image tolerance for PySide6 2021-01-16 14:37:21 +08:00
KIU Shueng Chuan
28c0ea4b33 test_ref_cycles.py : change skip criteria
test_ImageView()
- PySide6 fails the same as PySide2

test_PlotWidget() and test_GraphicsWindow()
- PySide6 succeeds.
- PySide2 also succeeds. (at least on Linux and on version 5.15.2)
2021-01-16 14:37:21 +08:00
Ogi Moore
cc6a4d200c Add analyze segment - thanks to @ksunden 2020-12-22 21:18:13 -08:00
Ogi Moore
3cd9f9ff63 skip test_reload 2020-12-22 10:26:19 -08:00
Dennis Göries
325a15a6ef
SignalProxy: Correct initialization without slot argument and tests (#1392)
* SignalProxy: Correct initialization without slot argument and provide tests

* Add missing slot is None case on disconnect

* Start new tests

* Exception block

* Test no module

* Different signal

* Debugging the signal connect

* Re initialize proxy after disconnect

* Add more test cases for blockSignal

* Change test case for signal count

* Give up for python 2 and pyside

* Exclude for Python 2.7 and PySide

* Convert float to integers in timer start period
2020-10-13 08:50:22 -07:00
Kenneth Lyons
fc957bbc4b Add targeted Vector test coverage 2020-09-20 09:19:39 -07:00
Luke Campagnola
6fe23887b8 update reload unit test 2020-07-17 10:00:32 +03:00
Luke Campagnola
dce9a5bf0c
Merge pull request #1310 from campagnola/acq4-merge
Acq4 merge
2020-07-13 16:13:38 -07:00
Luke Campagnola
5723853308 revert behavior: reload modules with no pyc
Should fix unit test. Also: return a structure from reloadAll describing reasons for failure of each module to reload.
2020-07-13 15:29:00 -07:00
Luke Campagnola
e2669f074b Add test for functions.subArray 2020-07-13 12:52:55 -07:00
Ogi Moore
47f06e78be
Merge branch 'develop' into pyside2-uic 2020-06-03 21:48:16 -07:00
Ogi
3ed8c49599 test_loadUiType should run on 5.14.2.2 2020-06-03 21:22:01 -07:00
Adam Strzelecki
983cc1695e
Patch/window handling (#468)
* Do not wrap PlotView/ImageView

There is no need to wrap PlotView/ImageView into QMainWindow, since
only purpose of the QMainWindow is some default menu toolbar & menu
handling, that is not used by PyQtGraph anyway.

Moreover, every parent-less Qt widget can become window, so this
change just use PlotView/ImageView as windows, removing extra
complexity, eg. method forwarding, self.win property.

Another benefit of this change, it that these windows get initial
dimensions and titles as they were designed in .ui file.

* Properly cleanup on ImageView.close()

We should not close explicitly child widgets or clear scene, otherwise
Qt will deallocate children views, and cause "wrapped C/C++ object of
type ImageItem has been deleted" error next time we call close()
and/or some other methods.

All children, including self.ui.roiPlot, self.ui.graphicsView will be
closed together with its parent, so there is no need to close them
explicitly.

So the purpose of close it to reclaim the memory, but not to make the existing ImageView object dysfunctional.

* Remove references to plot & image windows after close

PyQtGraph images and plots module list variables are currently holding
references to all plots and image windows returned directly from main
module. This does not seem to be documented however, and causes the Qt
windows to be not released from memory, even if user releases all own
references.

This change removes the references from images/plots list once window
is closed, so when there is no other reference, window and all related
memory is reclaimed.

* Change all UI forms title from Form to PyQtGraph

Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2020-06-01 11:23:18 -07:00
Ogi
dfe83dc1c8 Skipping this test on python 5.9 configs 2020-05-30 07:15:46 -07:00
Kenneth Lyons
988e5c1222 Test makeARGB with nans 2020-04-03 17:56:38 -07:00
Ognyan Moore
7199a4f4ce deepcopy(dict) does not necessarily preserve insertion order 2020-02-28 14:25:34 -08:00
Ognyan Moore
3195ed4c8f Skip some tests on pyside2 2020-02-26 10:06:02 -08:00
Ogi
19ae94765f Skip tests involving loadUi with pyside2 5.14 2020-02-24 23:00:42 -08:00
Ogi
428af4950d unskip py3 tests, weakref works fine in a list 2020-02-24 23:00:09 -08:00
Luke Campagnola
542f4b446b Add eq() support for comparing dict, list, tuple 2019-11-20 21:54:56 -08:00
Kenneth Lyons
faef56c3e7 Qulogic py3 fixes (#1073)
* py3k: Remove reduce calls.

* py3k: Remove compatibility sortList function.

Sorting by key has existed since Python 2.4.

* Remove unnecessary sys.path manipulation.

This file doesn't have any __main__ code to run anyway.

* Use context manager
2019-11-12 08:45:42 -08:00
Pepijn Kenter
3a863fff9a Fixes incorrect default value for scale parameter in makeARGB. (#793)
* Fix incorrect default value for scale paremter in makeARGB.

* update tests to pass with codebase change
2019-08-17 22:19:11 -07:00
Kenneth Lyons
26963ffbc4 Fix pg.exit test in case pyqtgraph is not installed 2019-06-25 23:20:28 -07:00
Kenneth Lyons
c210795cac Add test for exit function 2019-06-24 10:47:35 -07:00
2xB
9500f4db01 Allow multiline parameters in configparser (#949)
* FIX: Exception.message does not exist in Python3

* FIX: Allow multiline configfile parameters

* Added configparser tests

* Reasonable file ending for test files
2019-06-22 22:17:14 -07:00
2xB
fa2a03b8ec
Write Python representation of path to Python file
Before, if the path contained escaped sequences, they would be parsed before being written to `reload_test_mod.py`, therefore when the file was parsed by the Python interpreter, the escape signs would be missing. With this commit, the Python representation is written to the file, so escaped sequences stay escaped.
2019-06-18 20:14:51 +02:00
Ogi
5c44d51d6c remove resolution test, have display information printed during debug step 2019-06-09 16:25:22 -07:00
Ogi
2df71abfec We support pyside2 don't we? 2019-05-30 14:40:39 -07:00
Ogi
f2426e9dd2 Capture Screenshots 2019-05-30 14:40:39 -07:00