Help with Writing Tests - Foundation and community invite to help with 'do nothing' pass tests

Continuing the discussion from Help with Writing Tests:

These two queries identify 100+ empty test cases - each one is a test class with a ‘do nothing’ test body. So they represent I think a false sense of confidence or quality assurance of code health.

frappe@erpnext:~/frappe-bench$ find . -name ‘test*.py’ | xargs grep ’ pass’ | grep erpnext
frappe@erpnext:~/frappe-bench$ find . -name ‘test*.py’ | xargs grep ’ pass’ | grep frappe

Some of the test classes are:


apps/frappe/frappe/data_migration/doctype/data_migration_connector/ pass
apps/frappe/frappe/data_migration/doctype/data_migration_plan/ pass
apps/frappe/frappe/data_migration/doctype/data_migration_mapping/ pass


apps/frappe/frappe/email/doctype/email_group/ pass
apps/frappe/frappe/email/doctype/email_unsubscribe/ pass
apps/frappe/frappe/email/doctype/email_rule/ pass
apps/frappe/frappe/email/doctype/email_group_member/ pass
apps/frappe/frappe/email/doctype/email_queue/ pass
apps/frappe/frappe/email/doctype/email_flag_queue/ pass


The benefits to ERPNext from improved test coverage are immense, for a wide range of reasons not all of which are apparent.

For prospective developers (and veterans too), each test invites a clear path to quickly discover how that code applies, to support (test driven?) development.

To write the first test case is typically the biggest hump. After that, incremental extensions are less intimidating and more fun for users to extend an existing test.

For ERPNext to grow and flourish, the aim should be for a ‘test infected’ implementation.

However all of the empty tests represent a serious technical debt that should be resolved.

Thanks for listening


October 2017 Coverage was 39%.
Around Slide 18 there is a graph shared by

As a matter of fact, Frappe requires a coverage report in-built. Considering this!


Yes after all open source distinguishes itself with transparency visibility and ‘better together’ community sharing.

So arguably such a report would be good strategy, to challenge the status quo and inspire goals in terms of improved quality.

1 Like