beeware / beeware/toga

Reorganize Canvas tests

Open
#4,368 0 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
5.4k
Forks
827
Avg merge
15h 39m
Merged PRs (30d)
40

Description

### What is the problem or limitation you are having?

Between the way things have moved from place to place in the Canvas API, and the (intentional) duplication between methods and drawing actions, there are quite a number of behaviors we want to be consistently testing in two or even three places: the Canvas method, the DrawingAction, and (in cases where it doesn't behave differently) the deprecated State method.

The tests are currently organised into:

- test_canvas.py
- test_deprecations.py
- test_draw_operations.py
- test_helpers.py
- test_state_objects.py

### Describe the solution you'd like

I need to sit down and take a good look at things to decide what exactly a better organization will be, but I strongly suspect there are a number of tests we can parametrize together, some that can be grouped together more logically, and probably even some cases it would be useful to test that we're currently not.

### Describe alternatives you've considered

This isn't an urgent or glaring problem; the tests work well enough as-is. However, as we implement more and more of the API, they're probably going to get increasingly awkward in their current state.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by comparing the existing tests in test_canvas.py, test_deprecations.py, test_draw_operations.py, test_helpers.py, and test_state_objects.py. Map duplicated Canvas, DrawingAction, and deprecated State behavior, then identify logical groupings and useful parametrization. Done means the tests have a clearer organization, relevant shared cases are covered, and the test suite passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.