old_contents: from organize.core import should_execute
  
  
  def test_no_tags_given():
      assert should_execute(rule_tags=None, tags=None, skip_tags=None)
      assert should_execute(rule_tags=["tag"], tags=None, skip_tags=None)
      assert should_execute(rule_tags=["tag", "tag2"], tags=None, skip_tags=None)
  
  
  def test_run_tagged():
      assert not should_execute(rule_tags=None, tags=["tag"], skip_tags=None)
      assert should_execute(rule_tags=["tag"], tags=["tag"], skip_tags=None)
      assert should_execute(rule_tags=["tag", "tag2"], tags=["tag"], skip_tags=None)
      assert not should_execute(rule_tags=["foo", "bar"], tags=["tag"], skip_tags=None)
      assert not should_execute(rule_tags=["taggity"], tags=["tag"], skip_tags=None)
  
  
  def test_skip():
      assert should_execute(rule_tags=None, tags=None, skip_tags=["tag"])
      assert should_execute(rule_tags=["tag"], tags=None, skip_tags=["asd"])
      assert not should_execute(rule_tags=["tag"], tags=None, skip_tags=["tag"])
      assert not should_execute(rule_tags=["tag", "tag2"], tags=None, skip_tags=["tag"])
  
  
  def test_combination():
      assert not should_execute(rule_tags=None, tags=["tag"], skip_tags=["foo"])
      assert not should_execute(rule_tags=["foo", "tag"], tags=["tag"], skip_tags=["foo"])
  
  
  def test_always():
      assert should_execute(rule_tags=["always"], tags=["debug", "test"], skip_tags=None)
      assert should_execute(rule_tags=["always", "tag"], tags=None, skip_tags=["tag"])
      # skip only if specifically requested
      assert not should_execute(
          rule_tags=["always", "tag"], tags=None, skip_tags=["always"]
      )
  
  
  def test_never():
      assert not should_execute(rule_tags=["never"], tags=None, skip_tags=None)
      assert not should_execute(rule_tags=["never", "tag"], tags=["tag"], skip_tags=None)
      # run only if specifically requested
      assert should_execute(rule_tags=["never", "tag"], tags=["never"], skip_tags=None)
  
new_contents: import pytest
  from organize.core import should_execute
  
  
  @pytest.mark.parametrize(
      "result, rule_tags, tags, skip_tags",
      (
          # no tags given
          (True, None, None, None),
          (True, ["tag"], None, None),
          (True, ["tag", "tag2"], None, None),
          # run tagged
          (False, None, ["tag"], None),
          (True, ["tag"], ["tag"], None),
          (True, ["tag", "tag2"], ["tag"], None),
          (False, ["foo", "bar"], ["tag"], None),
          (False, ["taggity"], ["tag"], None),
          # skip
          (True, None, None, ["tag"]),
          (True, ["tag"], None, ["asd"]),
          (False, ["tag"], None, ["tag"]),
          (False, ["tag", "tag2"], None, ["tag"]),
          # combination
          (False, None, ["tag"], ["foo"]),
          (False, ["foo", "tag"], ["tag"], ["foo"]),
          # always
          (True, ["always"], ["debug", "test"], None),
          (True, ["always", "tag"], None, ["tag"]),
          # skip only if specifically requested
          (False, ["always", "tag"], None, ["always"]),
          # never
          (False, ["never"], None, None),
          (False, ["never", "tag"], ["tag"], None),
          # run only if specifically requested
          (True, ["never", "tag"], ["never"], None),
      ),
  )
  def test_tags(result, rule_tags, tags, skip_tags):
      assert should_execute(rule_tags=rule_tags, tags=tags, skip_tags=skip_tags) == result
  
subject: use fixtures in test_tag