def test_setting_getting_tags_on_metadata(taggable): slash.tag('tagname')(taggable) with slash.Session() as s: # pylint: disable=unused-variable tests = Loader().get_runnables(taggable) assert tests for t in tests: assert 'tagname' in t.__slash__.tags
def test_setting_getting_tags_on_metadata(taggable): slash.tag('tagname')(taggable) with slash.Session() as s: tests = Loader().get_runnables(taggable) assert tests for t in tests: assert 'tagname' in t.__slash__.tags
def test_tagging_twice_allowed_no_value(): @slash.tag('something') def test_something(): pass tagger = slash.tag('something') tagger(test_something)
def test_tagging_twice_allowed_same_values(): @slash.tag('something', 1) def test_something(): pass tagger = slash.tag('something', 1) tagger(test_something)
def __code__(): import slash @slash.parametrize('x', [ 500 // slash.param(tags=["regression", "ultra"]), 50 // slash.param(tags="regression"), 5 // slash.param(tags="sanity"), ]) @slash.parametrize('y', [ '100' // slash.tag("regression", "long"), '10' // slash.tag("regression", "short"), '1' // slash.tag("sanity"), ]) @slash.parametrize('z', [True, False]) def test_1(x, y, z): slash.context.result.data['params'] = (x, y, z)
def test_tagging_twice_forbidden_different_values(): @slash.tag('something', 1) def test_something(): pass tagger = slash.tag('something', 2) with pytest.raises(TaggingConflict): tagger(test_something)
class Tags(slash.Test): smoke = slash.tag('smoke') # tagging by simple decorator @slash.tag('simple') @smoke def test_tag_simple(self): assert 1 == 0 # tag has value @slash.tag('tagname', 'tagvalue') @smoke def test_tag_has_value(self): assert 1 == 0 # @tags.slash.tests.tag_storage.earlier_created_tag def test_earlier_created_tag(self): assert 1 == 0
class Tags(slash.Test): method = slash.tag("tags_speed_slash_method") @method def test_tag_simple(self): assert 1 == 0 @method def test_tag_simple1(self): assert 1 == 0 @method def test_tag_simple2(self): assert 1 == 0 @method def test_tag_simple3(self): assert 1 == 0 @method def test_tag_simple4(self): assert 1 == 0 @method def test_tag_simple5(self): assert 1 == 0 @method def test_tag_simple6(self): assert 1 == 0 @method def test_tag_simple7(self): assert 1 == 0 @method def test_tag_simple8(self): assert 1 == 0 @method def test_tag_simple9(self): assert 1 == 0
def test_setting_getting_tags(taggable): slash.tag('tagname')(taggable) assert 'tagname' in get_tags(taggable) assert 'other_tags' not in get_tags(taggable)
def wrap(f): import slash for platform in platforms: f = slash.tag(platform)(f) return f
import slash # tag created earlier earlier_created_tag = slash.tag('earlier created tag')