Currently a comparison like this will raise an error:
framework.status.PASS in ['pass']

This test currently fails, and is fixed by another patch in this series

v2: - update this test to work with constant statuses

Signed-off-by: Dylan Baker <[email protected]>
---
 framework/tests/status_tests.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/framework/tests/status_tests.py b/framework/tests/status_tests.py
index da3543d..3529036 100644
--- a/framework/tests/status_tests.py
+++ b/framework/tests/status_tests.py
@@ -63,6 +63,14 @@ def test_gen_lookup():
         yield yieldable, stat
 
 
+def test_status_in():
+    """ A status can be compared to a str with `x in container` syntax """
+    stat = status.PASS
+    slist = ['pass']
+
+    assert stat in slist
+
+
 def is_regression(x, y):
     # Test for regressions
     assert status.status_lookup(x) < status.status_lookup(y)
-- 
1.9.0

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to