Exemple #1
0
 def test_marked_one_arg_with_reason(self, testdir):
     item = testdir.getitem("""
         import pytest
         @pytest.mark.xyz("hasattr(os, 'sep')", attr=2, reason="hello world")
         def test_func():
             pass
     """)
     ev = MarkEvaluator(item, 'xyz')
     assert ev
     assert ev.istrue()
     expl = ev.getexplanation()
     assert expl == "hello world"
     assert ev.get("attr") == 2
Exemple #2
0
 def test_marked_one_arg_with_reason(self, testdir):
     item = testdir.getitem("""
         import pytest
         @pytest.mark.xyz("hasattr(os, 'sep')", attr=2, reason="hello world")
         def test_func():
             pass
     """)
     ev = MarkEvaluator(item, "xyz")
     assert ev
     assert ev.istrue()
     expl = ev.getexplanation()
     assert expl == "hello world"
     assert ev.get("attr") == 2
Exemple #3
0
 def test_marked_no_args(self, testdir):
     item = testdir.getitem("""
         import pytest
         @pytest.mark.xyz
         def test_func():
             pass
     """)
     ev = MarkEvaluator(item, 'xyz')
     assert ev
     assert ev.istrue()
     expl = ev.getexplanation()
     assert expl == ""
     assert not ev.get("run", False)
Exemple #4
0
 def test_marked_no_args(self, testdir):
     item = testdir.getitem("""
         import pytest
         @pytest.mark.xyz
         def test_func():
             pass
     """)
     ev = MarkEvaluator(item, "xyz")
     assert ev
     assert ev.istrue()
     expl = ev.getexplanation()
     assert expl == ""
     assert not ev.get("run", False)