From a6762f7328903af8157c4c120dda4f17f3a0f99f Mon Sep 17 00:00:00 2001 From: Jeffrey Rackauckas Date: Mon, 26 Feb 2018 19:11:13 -0800 Subject: [PATCH] Update test_skipping to test that platform can be used in xfail --- testing/test_skipping.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 08581e905..1abf4fcf6 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -156,6 +156,21 @@ class TestXFail(object): assert callreport.passed assert callreport.wasxfail == "this is an xfail" + def test_xfail_use_platform(self, testdir): + """ + Verify that platform can be used with xfail statements. + """ + item = testdir.getitem(""" + import pytest + @pytest.mark.xfail("platform.platform() == platform.platform()") + def test_func(): + assert 0 + """) + reports = runtestprotocol(item, log=False) + assert len(reports) == 3 + callreport = reports[1] + assert callreport.wasxfail + def test_xfail_xpassed_strict(self, testdir): item = testdir.getitem(""" import pytest