Skip to content

Instantly share code, notes, and snippets.

@m8ttyB
Forked from davehunt/gist:2988477
Created October 17, 2012 21:04
Show Gist options
  • Save m8ttyB/3908174 to your computer and use it in GitHub Desktop.
Save m8ttyB/3908174 to your computer and use it in GitHub Desktop.
Conditional xfails for pytest-mozwebqa tests.
import pytest
class TestConditionalXFails:
@pytest.mark.xfail("config.getvalue('platform') == 'MAC'")
def test_xfail_platform(self, mozwebqa):
assert False
@pytest.mark.xfail("config.getvalue('browser_name') == 'firefox'")
def test_xfail_browser_name(self, mozwebqa):
assert False
@pytest.mark.xfail("config.getvalue('browser_name') == 'firefox' and "
"int(config.getvalue('browser_version')) >= 10 and "
"config.getvalue('platform') == 'MAC'")
def test_xfail_browser_name_and_version_and_platform(self, mozwebqa):
assert False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment