google / google/openhtf

Unit Tests and AttachFromFile

Open
#394 1 comment 0 reactions 0 assignees View on GitHub
feature request
Dominant language
Python
Stars
722
Forks
237
Avg merge
11h 31m
Merged PRs (30d)
4

Description

New unit test util's are really useful.

Ran into a little bit of a pain point with test.AttachFromFile(filename) since need to mock out open:

```
mo = mock.mock_open()

with mock.patch('openhtf.exe.phase_data.open', mo, create=True):
phase_record = yield MyPhase

assert FILENAME in phase_record.attachments
```

Would be nice if we could make this happen under the hood.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.