napari / napari

napari: a fast, interactive, multi-dimensional image viewer for python
https://napari.org
BSD 3-Clause "New" or "Revised" License
2.07k stars 410 forks source link

Test dev examples #6854

Closed brisvag closed 3 weeks ago

brisvag commented 4 weeks ago

References and relevant issues

Alternative to #6763.

Description

Test dev examples to ensure they don't go out of sync.

brisvag commented 4 weeks ago

@Czaki the failing example is related to 2d hash in labels... is it even relevant anymore? If so, could you fix it?

Czaki commented 4 weeks ago

No. We have changed the hashing mechanism. I will try to check it tomorrow.

Czaki commented 3 weeks ago

The current mechanism is totally different, so I think that whole example could be removed.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.41%. Comparing base (9fcf63e) to head (9873f26).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6854 +/- ## ======================================= Coverage 92.41% 92.41% ======================================= Files 614 614 Lines 54862 54880 +18 ======================================= + Hits 50701 50718 +17 - Misses 4161 4162 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

brisvag commented 3 weeks ago

I don't liek the idea of having test-specific code in the examples... I'd rather just skip this one or refactor it ^^'

Czaki commented 3 weeks ago

I don't liek the idea of having test-specific code in the examples... I'd rather just skip this one or refactor it ^^'

Hm. Looking to documentation, maybe we should just monkeypatch sys.argv?

A number of alterations are also made to the sys module. Firstly, sys.path may be altered as described above. sys.argv[0] is updated with the value of path_name and sys.modules[name] is updated with a temporary module object for the module being executed. All modifications to items in sys are reverted before the function returns.

brisvag commented 3 weeks ago

What do you think of this version?

brisvag commented 3 weeks ago

Fail seems unrelated.