-
Notifications
You must be signed in to change notification settings - Fork 8
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
Make stub QgisInterface and MockMessageBar inherit real interfaces #54
base: main
Are you sure you want to change the base?
Make stub QgisInterface and MockMessageBar inherit real interfaces #54
Conversation
82b4875
to
f0a76ac
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #54 +/- ##
===========================================
- Coverage 57.77% 29.85% -27.92%
===========================================
Files 7 7
Lines 495 1065 +570
===========================================
+ Hits 286 318 +32
- Misses 209 747 +538
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
f0a76ac
to
64ad100
Compare
@LKajan, could you review this? |
@Joonalai this looks great from an outsider's perspective. Any tips on what is needed to get this merged in? |
@alukach, @Joonalai, I think we should avoid bringing typing "stubs" of QGIS classes into this project. This would create an endless need to update the typing annotations for every new QGIS version. The QGIS package is already typed; users just need to add a However, there are parts of this PR that could be considered for merging. I'll take another look now that I have some more time. |
@LKajan The typing itself is a bit of a secondary feature, correct? The key value add of this PR is supporting realistic interactions with the
How can I help you in terms of resolving issues like these with the plugin? |
@alukach, you are right that this would kind of solve the issue you're having. Still I wonder if this should be addressed probably by using mocking (using For your case, you could extend the faked @pytest.fixture(scope="session")
def qgis_iface(qgis_iface: QgisInterface):
qgis_iface.pluginMenu=Mock()
return qgis_iface |
This PR:
QgisInterface
andQgsMessageBar
to inherit their real parentsFixes #24, fixes #26.