Skip to content

Commit

Permalink
Fix validators documentation (#926)
Browse files Browse the repository at this point in the history
* Fix validators documentation

* Update validators.py

* Update json_factory.py
  • Loading branch information
tcm0116 authored Mar 3, 2020
1 parent 195d005 commit 4fa142e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openhtf/output/callbacks/json_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class OutputToJSON(callbacks.OutputToFile):
'/data/test_records/%(dut_id)s.%(start_time_millis)s'
To use this output mechanism:
test = openhtf.Test(PhaseOne, PhaseTwo)
test.add_output_callback(openhtf.output.callbacks.OutputToJson(
test.add_output_callback(openhtf.output.callbacks.OutputToJSON(
'/data/test_records/{dut_id}.{metadata[test_name]}.json'))
Args:
Expand Down
5 changes: 2 additions & 3 deletions openhtf/util/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
module, and will typically be a type, instances of which are callable:
from openhtf.util import validators
from openhtf.util import measurements
class MyLessThanValidator(ValidatorBase):
class MyLessThanValidator(validators.ValidatorBase):
def __init__(self, limit):
self.limit = limit
Expand Down Expand Up @@ -35,7 +34,7 @@ def LessThan4(value):
return value < 4
@measurements.measures(
measurements.Measurement('my_measurement).with_validator(LessThan4))
measurements.Measurement('my_measurement').with_validator(LessThan4))
def MyPhase(test):
test.measurements.my_measurement = 5 # Will also 'FAIL'
Expand Down

0 comments on commit 4fa142e

Please sign in to comment.