mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
testing: add Attr
Add a new Attr method to testing.TB that emits a test attribute. An attribute is an arbitrary key/value pair. Fixes #43936 Change-Id: I7ef299efae41f2cf39f2dc61ad4cdd4c3975cdb6 Reviewed-on: https://go-review.googlesource.com/c/go/+/662437 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com> Auto-Submit: Damien Neil <dneil@google.com>
This commit is contained in:
parent
763963505e
commit
3cc8b532f9
7 changed files with 117 additions and 0 deletions
10
doc/next/6-stdlib/99-minor/testing/43936.md
Normal file
10
doc/next/6-stdlib/99-minor/testing/43936.md
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
The new methods [T.Attr], [B.Attr], and [F.Attr] emit an
|
||||
attribute to the test log. An attribute is an arbitrary
|
||||
key and value associated with a test.
|
||||
|
||||
For example, in a test named `TestAttr`,
|
||||
`t.Attr("key", "value")` emits:
|
||||
|
||||
```
|
||||
=== ATTR TestAttr key value
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue