code: def test_previous_and_next_release(fake_issue_tracker):
      r = Release("4.0.0", repo=None, issue_tracker=fake_issue_tracker)
      assert isinstance(r.previous, MajorRelease)
      assert r.previous.version == Version.parse("3.0.0")
      with pytest.raises(
          ValueError, match="There is no upcoming release set"
      ):
          assert r.next
  
      r = Release("3.0.0", repo=None, issue_tracker=fake_issue_tracker)
      assert isinstance(r.previous, MajorRelease)
      assert isinstance(r.next, MajorRelease)
      assert r.previous.version == Version.parse("2.0.0")
      assert r.next.version == Version.parse("4.0.0")
  
      r = Release("1.1.0", repo=None, issue_tracker=fake_issue_tracker)
      assert isinstance(r.previous, MajorRelease)
      assert isinstance(r.next, MajorRelease)
      assert r.previous.version == Version.parse("1.0.0")
      assert r.next.version == Version.parse("2.0.0")
  
      r = Release("1.0.0", repo=None, issue_tracker=fake_issue_tracker)
      assert isinstance(r.next, MajorRelease)
      assert isinstance(r.previous, MajorRelease)
      assert r.previous.version == Version.parse("0.17.0")
      assert r.next.version == Version.parse("2.0.0")
  
      r = Release("0.17.0", repo=None, issue_tracker=fake_issue_tracker)
      assert isinstance(r.previous, MajorRelease)
      assert r.previous.version == Version.parse("0.16.0")
  
      r = Release("0.15.2", repo=None, issue_tracker=fake_issue_tracker)
      assert isinstance(r.previous, PatchRelease)
      assert isinstance(r.next, MajorRelease)
      assert r.previous.version == Version.parse("0.15.1")
      assert r.next.version == Version.parse("0.16.0")
  
      r = Release("0.15.1", repo=None, issue_tracker=fake_issue_tracker)
      assert isinstance(r.previous, MajorRelease)
      assert isinstance(r.next, PatchRelease)
      assert r.previous.version == Version.parse("0.15.0")
      assert r.next.version == Version.parse("0.15.2")
  
file_path: arrow/dev/archery/archery/release/tests/test_release.py
imports: import pytest
  from archery.release.core import Release, MajorRelease, MinorRelease, PatchRelease, IssueTracker, Version, Issue, CommitTitle, Commit
  from archery.testing import DotDict
label_desc: Use image node_id 6 for calling a global function with example usage: test_previous_and_next_release(fake_issue_tracker) without return types