Skip to content
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

Fix some warnings from unit tests #2929

Merged
merged 4 commits into from
Sep 6, 2024
Merged

Conversation

soininen
Copy link
Contributor

@soininen soininen commented Sep 6, 2024

We get a few warnings when running the unit tests on Ubuntu. This fixes some of those but unfortunately does not help with the segfaults.

Most notably, CompoundModelBase.handle_items_removed() has been largely rewritten. We now properly call beginRemoveRows() and endRemoveRows() instead of just recalculating the row and inverse row maps and emitting layoutChanged which left the table views in a somewhat confused state.

Re #2921

Checklist before merging

  • Documentation is up-to-date
  • Release notes have been updated
  • Unit tests have been added/updated accordingly
  • Code has been formatted by black & isort
  • Unit tests pass

We now paint using the QPaintEngine of a QImage which removes
warnings when running unit tests on Linux.
This removes a warning when running unit tests on Linux.
In CompoundModelBase.handle_items_removed() we took a shortcut
and emitted layoutAboutToBeChanged and layoutChanged signals.
This doesn't update e.g. a view's current index which causes
some warning messages (at least on Linux).
We now properly remove the rows using beginRemoveRows() and
endRemoveRows().
Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 96.55172% with 2 lines in your changes missing coverage. Please review.

Project coverage is 66.88%. Comparing base (27d5f5d) to head (5163bde).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
spinetoolbox/mvcmodels/compound_table_model.py 88.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2929      +/-   ##
==========================================
+ Coverage   66.86%   66.88%   +0.01%     
==========================================
  Files         190      190              
  Lines       37027    37063      +36     
  Branches     6355     6367      +12     
==========================================
+ Hits        24759    24790      +31     
- Misses      10945    10952       +7     
+ Partials     1323     1321       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@soininen soininen merged commit 6cdd3a3 into master Sep 6, 2024
22 checks passed
@soininen soininen deleted the unit_test_fixes_on_ubuntu branch September 6, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant