Skip to content

Conversation

@7576457
Copy link
Contributor

@7576457 7576457 commented Jan 8, 2026

Description

This PR adds long press and hover events. Support for these events already exists in Flutter, so the changes are limited to exposing them in the API.

Test Code

import flet as ft


def main(page: ft.Page):
    page.add(
        ft.Row(
            [
                ft.IconButton(
                    icon=ft.Icons.CANCEL,
                    icon_color=ft.Colors.PINK_700,
                    icon_size=40,
                    tooltip="Nope",
                    on_long_press=lambda e: print(e),
                    on_hover=lambda e: print(e),
                ),
                ft.Button(
                    icon=ft.Icons.CANCEL,
                    icon_color=ft.Colors.PINK_700,
                    content="text",
                    tooltip="Nope",
                    on_long_press=lambda e: print(e),
                ),
            ],
            alignment=ft.MainAxisAlignment.CENTER,
        ),
    )

ft.run(main)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I signed the CLA.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass locally with my changes
  • I have made corresponding changes to the documentation (if applicable)

Screenshots

изображение

Summary by Sourcery

Expose additional interaction handlers on the IconButton control.

New Features:

  • Add long-press event handler support to IconButton.
  • Add hover event handler support to IconButton.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@7576457
Copy link
Contributor Author

7576457 commented Jan 8, 2026

I'm having trouble getting the tests to run successfully 🤔

When I run uv run pytest, a window pops up with a button labeled "Do some lengthy task!". After closing it, I get errors (see details). The errors indicate that pytest is trying to collect tests from the files, but during import it ends up picking up duplicate test modules.

Details
(.venv) PS C:\Users\Jesuh\dev\flet\sdk\python> uv run pytest
========================================================== test session starts ==========================================================
platform win32 -- Python 3.13.6, pytest-9.0.2, pluggy-1.6.0
rootdir: C:\Users\Jesuh\dev\flet\sdk\python
configfile: pyproject.toml
plugins: anyio-4.12.0, asyncio-1.3.0, timeout-2.4.0
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 393 items / 54 errors                                                                                                          

================================================================ ERRORS ================================================================= 
___________________________ ERROR collecting packages/flet/integration_tests/apps/counter/test_counter_app.py ___________________________ 
ImportError while importing test module 'C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\apps\counter\test_counter_app.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
..\..\..\..\AppData\Roaming\uv\python\cpython-3.13.6-windows-x86_64-none\Lib\importlib\__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   ModuleNotFoundError: No module named 'counter.test_counter_app'; 'counter' is not a package
__________________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_action_sheet.py ___________________ 
import file mismatch:
imported module 'test_cupertino_action_sheet' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_action_sheet.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_action_sheet.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_______________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_activity_indicator.py ________________ 
import file mismatch:
imported module 'test_cupertino_activity_indicator' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_activity_indicator.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_activity_indicator.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_____________________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_button.py ______________________ 
import file mismatch:
imported module 'test_cupertino_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
____________________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_checkbox.py _____________________ 
import file mismatch:
imported module 'test_cupertino_checkbox' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_checkbox.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_checkbox.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
__________________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_filled_button.py __________________ 
import file mismatch:
imported module 'test_cupertino_filled_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_filled_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_filled_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
____________________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_list_tile.py ____________________ 
import file mismatch:
imported module 'test_cupertino_list_tile' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_list_tile.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_list_tile.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_radio.py ______________________ 
import file mismatch:
imported module 'test_cupertino_radio' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_radio.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_radio.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
________________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_segmented_button.py _________________ 
import file mismatch:
imported module 'test_cupertino_segmented_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_segmented_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_segmented_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_____________________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_slider.py ______________________ 
import file mismatch:
imported module 'test_cupertino_slider' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_slider.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_slider.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
____________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_sliding_segmented_button.py _____________ 
import file mismatch:
imported module 'test_cupertino_sliding_segmented_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_sliding_segmented_button.py        
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_sliding_segmented_button.py        
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_____________________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_switch.py ______________________ 
import file mismatch:
imported module 'test_cupertino_switch' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_switch.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_switch.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
__________________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_timer_picker.py ___________________ 
import file mismatch:
imported module 'test_cupertino_timer_picker' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_timer_picker.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_timer_picker.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
__________________ ERROR collecting packages/flet/integration_tests/examples/cupertino/test_cupertino_tinted_button.py __________________ 
import file mismatch:
imported module 'test_cupertino_tinted_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\cupertino\test_cupertino_tinted_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\cupertino\test_cupertino_tinted_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_alert_dialog.py ________________________ 
import file mismatch:
imported module 'test_alert_dialog' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_alert_dialog.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_alert_dialog.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
__________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_app_bar.py ___________________________ 
import file mismatch:
imported module 'test_app_bar' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_app_bar.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_app_bar.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
___________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_badge.py ____________________________ 
import file mismatch:
imported module 'test_badge' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_badge.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_badge.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
___________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_banner.py ___________________________ 
import file mismatch:
imported module 'test_banner' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_banner.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_banner.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_______________________ ERROR collecting packages/flet/integration_tests/examples/material/test_bottom_app_bar.py _______________________ 
import file mismatch:
imported module 'test_bottom_app_bar' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_bottom_app_bar.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_bottom_app_bar.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_bottom_sheet.py ________________________ 
import file mismatch:
imported module 'test_bottom_sheet' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_bottom_sheet.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_bottom_sheet.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
___________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_button.py ___________________________ 
import file mismatch:
imported module 'test_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
____________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_card.py ____________________________ 
import file mismatch:
imported module 'test_card' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_card.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_card.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
__________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_checkbox.py __________________________ 
import file mismatch:
imported module 'test_checkbox' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_checkbox.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_checkbox.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
____________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_chip.py ____________________________ 
import file mismatch:
imported module 'test_chip' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_chip.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_chip.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_______________________ ERROR collecting packages/flet/integration_tests/examples/material/test_circle_avatar.py ________________________ 
import file mismatch:
imported module 'test_circle_avatar' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_circle_avatar.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_circle_avatar.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_context_menu.py ________________________ 
import file mismatch:
imported module 'test_context_menu' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_context_menu.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_context_menu.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
__________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_divider.py ___________________________ 
import file mismatch:
imported module 'test_divider' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_divider.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_divider.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
__________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_dropdown.py __________________________ 
import file mismatch:
imported module 'test_dropdown' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_dropdown.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_dropdown.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
____________________ ERROR collecting packages/flet/integration_tests/examples/material/test_expansion_panel_list.py ____________________ 
import file mismatch:
imported module 'test_expansion_panel_list' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_expansion_panel_list.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_expansion_panel_list.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_______________________ ERROR collecting packages/flet/integration_tests/examples/material/test_expansion_tile.py _______________________ 
import file mismatch:
imported module 'test_expansion_tile' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_expansion_tile.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_expansion_tile.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_______________________ ERROR collecting packages/flet/integration_tests/examples/material/test_filled_button.py ________________________ 
import file mismatch:
imported module 'test_filled_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_filled_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_filled_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
____________________ ERROR collecting packages/flet/integration_tests/examples/material/test_filled_tonal_button.py _____________________ 
import file mismatch:
imported module 'test_filled_tonal_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_filled_tonal_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_filled_tonal_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
___________________ ERROR collecting packages/flet/integration_tests/examples/material/test_floating_action_button.py ___________________ 
import file mismatch:
imported module 'test_floating_action_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_floating_action_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_floating_action_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_icon_button.py _________________________ 
import file mismatch:
imported module 'test_icon_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_icon_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_icon_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_list_tile.py __________________________ 
import file mismatch:
imported module 'test_list_tile' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_list_tile.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_list_tile.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
__________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_menu_bar.py __________________________ 
import file mismatch:
imported module 'test_menu_bar' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_menu_bar.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_menu_bar.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________ ERROR collecting packages/flet/integration_tests/examples/material/test_menu_item_button.py ______________________ 
import file mismatch:
imported module 'test_menu_item_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_menu_item_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_menu_item_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_______________________ ERROR collecting packages/flet/integration_tests/examples/material/test_navigation_bar.py _______________________ 
import file mismatch:
imported module 'test_navigation_bar' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_navigation_bar.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_navigation_bar.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_____________________ ERROR collecting packages/flet/integration_tests/examples/material/test_navigation_drawer.py ______________________ 
import file mismatch:
imported module 'test_navigation_drawer' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_navigation_drawer.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_navigation_drawer.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________ ERROR collecting packages/flet/integration_tests/examples/material/test_navigation_rail.py _______________________ 
import file mismatch:
imported module 'test_navigation_rail' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_navigation_rail.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_navigation_rail.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________ ERROR collecting packages/flet/integration_tests/examples/material/test_outlined_button.py _______________________ 
import file mismatch:
imported module 'test_outlined_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_outlined_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_outlined_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_____________________ ERROR collecting packages/flet/integration_tests/examples/material/test_popup_menu_button.py ______________________ 
import file mismatch:
imported module 'test_popup_menu_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_popup_menu_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_popup_menu_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_progress_bar.py ________________________ 
import file mismatch:
imported module 'test_progress_bar' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_progress_bar.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_progress_bar.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
___________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_radio.py ____________________________ 
import file mismatch:
imported module 'test_radio' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_radio.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_radio.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_range_slider.py ________________________ 
import file mismatch:
imported module 'test_range_slider' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_range_slider.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_range_slider.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
___________________ ERROR collecting packages/flet/integration_tests/examples/material/test_reorderable_list_view.py ____________________ 
import file mismatch:
imported module 'test_reorderable_list_view' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_reorderable_list_view.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_reorderable_list_view.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_search_bar.py _________________________ 
import file mismatch:
imported module 'test_search_bar' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_search_bar.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_search_bar.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________ ERROR collecting packages/flet/integration_tests/examples/material/test_segmented_button.py ______________________ 
import file mismatch:
imported module 'test_segmented_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_segmented_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_segmented_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
___________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_slider.py ___________________________ 
import file mismatch:
imported module 'test_slider' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_slider.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_slider.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_snack_bar.py __________________________ 
import file mismatch:
imported module 'test_snack_bar' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_snack_bar.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_snack_bar.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_______________________ ERROR collecting packages/flet/integration_tests/examples/material/test_submenu_button.py _______________________ 
import file mismatch:
imported module 'test_submenu_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_submenu_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_submenu_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_text_button.py _________________________ 
import file mismatch:
imported module 'test_text_button' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_text_button.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_text_button.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
_________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_textfield.py __________________________ 
import file mismatch:
imported module 'test_textfield' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_textfield.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_textfield.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
________________________ ERROR collecting packages/flet/integration_tests/examples/material/test_time_picker.py _________________________ 
import file mismatch:
imported module 'test_time_picker' has this __file__ attribute:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\controls\material\test_time_picker.py
which is not the same as the test file we want to collect:
  C:\Users\Jesuh\dev\flet\sdk\python\packages\flet\integration_tests\examples\material\test_time_picker.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
======================================================== short test summary info ======================================================== 
ERROR packages/flet/integration_tests/apps/counter/test_counter_app.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_action_sheet.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_activity_indicator.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_button.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_checkbox.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_filled_button.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_list_tile.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_radio.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_segmented_button.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_slider.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_sliding_segmented_button.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_switch.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_timer_picker.py
ERROR packages/flet/integration_tests/examples/cupertino/test_cupertino_tinted_button.py
ERROR packages/flet/integration_tests/examples/material/test_alert_dialog.py
ERROR packages/flet/integration_tests/examples/material/test_app_bar.py
ERROR packages/flet/integration_tests/examples/material/test_badge.py
ERROR packages/flet/integration_tests/examples/material/test_banner.py
ERROR packages/flet/integration_tests/examples/material/test_bottom_app_bar.py
ERROR packages/flet/integration_tests/examples/material/test_bottom_sheet.py
ERROR packages/flet/integration_tests/examples/material/test_button.py
ERROR packages/flet/integration_tests/examples/material/test_card.py
ERROR packages/flet/integration_tests/examples/material/test_checkbox.py
ERROR packages/flet/integration_tests/examples/material/test_chip.py
ERROR packages/flet/integration_tests/examples/material/test_circle_avatar.py
ERROR packages/flet/integration_tests/examples/material/test_context_menu.py
ERROR packages/flet/integration_tests/examples/material/test_divider.py
ERROR packages/flet/integration_tests/examples/material/test_dropdown.py
ERROR packages/flet/integration_tests/examples/material/test_expansion_panel_list.py
ERROR packages/flet/integration_tests/examples/material/test_expansion_tile.py
ERROR packages/flet/integration_tests/examples/material/test_filled_button.py
ERROR packages/flet/integration_tests/examples/material/test_filled_tonal_button.py
ERROR packages/flet/integration_tests/examples/material/test_floating_action_button.py
ERROR packages/flet/integration_tests/examples/material/test_icon_button.py
ERROR packages/flet/integration_tests/examples/material/test_list_tile.py
ERROR packages/flet/integration_tests/examples/material/test_menu_bar.py
ERROR packages/flet/integration_tests/examples/material/test_menu_item_button.py
ERROR packages/flet/integration_tests/examples/material/test_navigation_bar.py
ERROR packages/flet/integration_tests/examples/material/test_navigation_drawer.py
ERROR packages/flet/integration_tests/examples/material/test_navigation_rail.py
ERROR packages/flet/integration_tests/examples/material/test_outlined_button.py
ERROR packages/flet/integration_tests/examples/material/test_popup_menu_button.py
ERROR packages/flet/integration_tests/examples/material/test_progress_bar.py
ERROR packages/flet/integration_tests/examples/material/test_radio.py
ERROR packages/flet/integration_tests/examples/material/test_range_slider.py
ERROR packages/flet/integration_tests/examples/material/test_reorderable_list_view.py
ERROR packages/flet/integration_tests/examples/material/test_search_bar.py
ERROR packages/flet/integration_tests/examples/material/test_segmented_button.py
ERROR packages/flet/integration_tests/examples/material/test_slider.py
ERROR packages/flet/integration_tests/examples/material/test_snack_bar.py
ERROR packages/flet/integration_tests/examples/material/test_submenu_button.py
ERROR packages/flet/integration_tests/examples/material/test_text_button.py
ERROR packages/flet/integration_tests/examples/material/test_textfield.py
ERROR packages/flet/integration_tests/examples/material/test_time_picker.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 54 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
========================================================== 54 errors in 19.22s ========================================================== 

@ndonkoHenri
Copy link
Contributor

I'm having trouble getting the tests to run successfully

See this guide on running tests: https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet/integration_tests/README.md

CI for your PR tells us everything is OK: https://github.com/flet-dev/flet/actions/runs/20817087876?pr=5984 😉

@ndonkoHenri ndonkoHenri linked an issue Jan 9, 2026 that may be closed by this pull request
1 task
@ndonkoHenri ndonkoHenri merged commit 85676d5 into flet-dev:main Jan 12, 2026
27 checks passed
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.

feature: Add on_long_press to ft.IconButton()

3 participants