django-stubs icon indicating copy to clipboard operation
django-stubs copied to clipboard

Improve typing in template registry

Open Viicos opened this issue 1 year ago • 4 comments

Fixes #1903

Viicos avatar Jan 14 '24 11:01 Viicos

I'm fine with adding the tests, since e.g. the decorators aren't trivial. But I'd say we should bundle them under the same test, some "decorator test".

Mainly as the suite gets slowed down quite a bit with multiple tests.

Will do. I'll also try to add some comments in the stubs, so that it's easier to reason about which overload matches to which use case

Viicos avatar Mar 20 '24 15:03 Viicos

Assigned to @flaeppe. If you don't want to lead the review here, feel free to unassign yourself.

intgr avatar Mar 25 '24 10:03 intgr

I'm fine with adding the tests, since e.g. the decorators aren't trivial. But I'd say we should bundle them under the same test, some "decorator test".

Mainly as the suite gets slowed down quite a bit with multiple tests.

Thinking again about this, maybe this would things a bit confusing? We would end up with tests of the same module in a separate location.

But if still think we should do it this way, I can work on another PR moving every decorator tests, once this one gets merged (will makes things easier to review)

Viicos avatar Apr 02 '24 17:04 Viicos

Thinking again about this, maybe this would things a bit confusing? We would end up with tests of the same module in a separate location.

I meant gathering the newly added tests in this PR under the same test case. e.g. test_library_decorators. That shouldn't result in multiple locations.

But if still think we should do it this way, I can work on another PR moving every decorator tests, once this one gets merged (will makes things easier to review)

If you like to refactor existing tests in a separate PR later on, that's fine too

flaeppe avatar Apr 04 '24 07:04 flaeppe