Skip to content

Show line number of the failing assert in unittests #290

@hlopko

Description

@hlopko

Hi dear Skylib maintainers,

right now we print the assertion error with the location .../external/bazel_skylib/lib/unittest.bzl:351:10:. It would be much more useful if we either printed the entire stack trace, or show the location of the callsite.

An argument could be made that there should be just one assertion per unit test, in that scenario this is not a problem. However there is so much boilerplate involved with adding a unit test that this is not practical to have one assertion per test. And even Bazel's internal BuildViewTestCase tests have multiple assertions per test.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering to work on this, but happy to review a PR. (No assignee)type: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions