Skip to content

Commit

Permalink
Clean up cruft in test_git
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 1, 2024
1 parent 7bcfd8a commit b10534e
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions tests/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,25 @@

def test_subprocess_manager_invalid_when_exe_missing():
"""
If the hg executable dosen't exist, the manager should report
If the executable dosen't exist, the manager should report
False for .is_valid().
"""
non_existent_exe = '/non_existent_executable'
assert not os.path.exists(non_existent_exe)
mgr = subprocess.Git()
mgr.exe = non_existent_exe
assert not mgr.is_valid()
repo = subprocess.Git()
repo.exe = non_existent_exe
assert not repo.is_valid()


@pytest.mark.usefixtures("git_repo")
class TestTags:
def setup_method(self, method):
self.mgr = vcs.Git('.')

def teardown_method(self, method):
del self.mgr

def test_single_tag(self):
assert self.mgr.get_tags() == set()
self.mgr._invoke('tag', '-am', "Tagging 1.0", '1.0')
assert self.mgr.get_tags() == {'1.0'}
self.mgr._invoke('checkout', '1.0')
assert self.mgr.get_tags() == {'1.0'}
repo = vcs.Git('.')
assert repo.get_tags() == set()
repo._invoke('tag', '-am', "Tagging 1.0", '1.0')
assert repo.get_tags() == {'1.0'}
repo._invoke('checkout', '1.0')
assert repo.get_tags() == {'1.0'}


class TestParseVersion:
Expand All @@ -47,9 +42,9 @@ def test_trailing_mess(self):
@pytest.mark.usefixtures("git_repo")
class TestRevisionTimestamp:
def test_tagged_rev_timestamp(self):
mgr = vcs.Git('.')
mgr._invoke('tag', '-am', 'tagging 1.0', '1.0')
assert mgr.get_timestamp('1.0').date() == datetime.date.today()
repo = vcs.Git('.')
repo._invoke('tag', '-am', 'tagging 1.0', '1.0')
assert repo.get_timestamp('1.0').date() == datetime.date.today()


class TestIsolation:
Expand Down

0 comments on commit b10534e

Please sign in to comment.