Skip to content

Instantly share code, notes, and snippets.

@BeyondEvil
Created December 3, 2015 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BeyondEvil/c37047520949789d378d to your computer and use it in GitHub Desktop.
Save BeyondEvil/c37047520949789d378d to your computer and use it in GitHub Desktop.
def pytest_runtest_setup(item):
"""
py.test hook for test configuration
:param item: py.test item module
:return: None
"""
from tools import TagsCollection
print "IN RUNTEST"
print item
config = item.config
# Get all tags for this test (includes tags on class level if present)
tags = item.get_marker("tags")
# Create a list of the tags
tags_list = TagsCollection.build_tags_list(tags.args)
# Determine if test shoul be run depending on the parameter tags
# See also: pytest_configure hook
if not config.parameter_tags.should_pick_up(tags_list):
pytest.skip("Skipping test!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment