Skip to content

Commit 27cb745

Browse files
committed
[test/validation] Add clear output method
1 parent c325e85 commit 27cb745

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/test_validation_integration.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ def tearDown(self):
2828
sys.stdout = self.stdout_orig
2929
self.capture.close()
3030

31+
def _clear_output(self):
32+
self.capture.seek(0)
33+
self.capture.truncate()
34+
3135
def _get_captured_output(self):
3236
out = [txt.strip() for txt in self.capture.getvalue().split('\n') if txt]
3337

@@ -42,6 +46,9 @@ def test_property_values_cardinality(self):
4246
doc = odml.Document()
4347
sec = odml.Section(name="sec", type="sec_type", parent=doc)
4448

49+
# Making sure only the required warnings are tested
50+
self._clear_output()
51+
4552
# -- Test cardinality validation warnings on Property init
4653
# Test warning when setting invalid minimum
4754
_ = odml.Property(name="prop_card_min", values=[1], val_cardinality=(2, None), parent=sec)

0 commit comments

Comments
 (0)