Comments (5)
And/or perhaps we should use --with-isolation
so that each test is indeed supposed to run separately from each other. We could then provide setup
and teardown
functions in tests.py in case something needs to be setup prior to the run and then teared down after the run.
@with_setup(setup_x, teardown_x)
I found this a nice resource explaining (with examples) how setup runs before the test and then teardown after the test: http://pythontesting.net/framework/nose/nose-introduction/
This seem to be sort of like a standard approach to using nose. And we kind of already use this approach, but the term clean
makes it a little confusing in my mind. Perhaps it would be better to do the cleaning using --with-isolation
and then use the decorator to provide setup/teardown when required.
from qt.py.
I'll set up a PR in case you think this is a good suggestion.
from qt.py.
Python does not support unloading modules
This is true, but it isn't really doing that. All it's doing is ensuring that Qt.py
is re-read at each import and that any variables it reads are reset so that our tests can run it multiple times without affecting each other. It will likely only work in this unique case, and not so much with other modules (did you try with sip
?).
And/or perhaps we should use --with-isolation so that each test is indeed supposed to run separately from each other.
As far as I can tell, --with-isolation
does what you did in your example.
The isolation plugin resets the contents of sys.modules after running each test module or package. Link
But it's a good point. It would be good if each test could be completely isolated. As in, being their own process. I'm sure there's an option for this with nose, I just haven't experienced it.
from qt.py.
Maybe something like this could enable isolation.
from qt.py.
Nice find!
PR coming up...
from qt.py.
Related Issues (20)
- looks like QtGui.QGuiApplication is not wrapped... HOT 1
- Table Drop Event and loadUi with PySide2 HOT 3
- Add PySide6 support HOT 20
- https://github.com/spyder-ide/qtpy/issues/348 HOT 6
- QtCompat.isValid() Not Available for All Qt Objects HOT 8
- How to add menubar in QT?
- Drop PyQt because it may be illegal to import a GPL lib from a lib under MIT HOT 1
- TypeError: Expected 4 or 5 arguments, got 3. HOT 1
- Is it possible to add support for QIdentityProxyModel HOT 1
- Change of types-PySide2 breaks Python 2 compatibility HOT 10
- TypeError: 'PySide2.QtWidgets.QWidget' called with wrong argument types
- partially initialized module 'Qt' has no attribute 'QtGui' (most likely due to a circular import)
- Convert does not convert files built with pyside2-uic 5.15.2 HOT 1
- signal.connect() TypeError in pyqt5 when signal has an argument HOT 9
- stubs missing signal.connect, disconnect and emit HOT 6
- Cannot install v1.3.8 from sdist HOT 6
- The imp module is removed with Python 3.12
- Running tests fails
- Code completion inserts references to PySide2 HOT 1
- headerToModule() is destructive when CustomWidget path is a Python . path HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qt.py.