Skip to content

Commit

Permalink
In tests, always use alpharep fixture.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Sep 17, 2023
1 parent 92a8531 commit c331584
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,12 @@ def test_open_write(self):
with zf.joinpath('file.txt').open('w', encoding="utf-8") as strm:
strm.write('text file')

def test_open_extant_directory(self):
@pass_alpharep
def test_open_extant_directory(self, alpharep):
"""
Attempting to open a directory raises IsADirectoryError.
"""
zf = zipp.Path(add_dirs(build_alpharep_fixture()))
zf = zipp.Path(alpharep)
with self.assertRaises(IsADirectoryError):
zf.joinpath('b').open()

Expand All @@ -232,11 +233,12 @@ def test_open_binary_invalid_args(self, alpharep):
with self.assertRaises(ValueError):
root.joinpath('a.txt').open('rb', 'utf-8')

def test_open_missing_directory(self):
@pass_alpharep
def test_open_missing_directory(self, alpharep):
"""
Attempting to open a missing directory raises FileNotFoundError.
"""
zf = zipp.Path(add_dirs(build_alpharep_fixture()))
zf = zipp.Path(alpharep)
with self.assertRaises(FileNotFoundError):
zf.joinpath('z').open()

Expand Down

0 comments on commit c331584

Please sign in to comment.