HIPS/autograd

Do away with `combo_check` and switch to test parametrization

开放

#662 创建于 2024年12月2日

 (0 条评论) (0 个反应) (0 位负责人)Python (909 个派生)batch import
PR welcomeenhancementgood first issue

仓库指标

星标
 (6,628 个星标)
PR 合并指标
 (平均合并 51天 7小时) (30 天内合并 16 个 PR)

描述

the combo_check function predates many improvements made in testing infrastructure over recent years, and is quite dated now. I propose that we refactor the test suite to use pytest better and pave the way for it to be nicer for maintainers and new contributors.

If we were to deprecate the combo_check function and change to a few simple pytest parametrization decorators, we would know exactly what sub-test fails in a test, and where – i.e., which would better isolate the failure instead of us having to do it ourselves.

from @agriyakhetarpal in https://github.com/HIPS/autograd/pull/643#issuecomment-2509794644

I agree with this idea. Presumably we should be able to get roughly equivalent tests using pytest parameterized tests. If you do implement this it might be worth checking that it doesn't slow the tests down (I like the fact that our tests are really fast).

from @j-towns in https://github.com/HIPS/autograd/pull/643#issuecomment-2510845561

A task list

  • reimplement combo_check in terms of pytest fixtures and parametrized test methods
  • parametrize tests where possible and where combo_check is used
  • make autograd.test_util a private API where possible

贡献者指南