Skip to content

Commit

Permalink
Add tests for pushd. Increases coverage from 66% to 71%.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jan 18, 2023
1 parent 7b16fd4 commit 9c1a7ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jaraco/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@

@contextlib.contextmanager
def pushd(dir):
"""
>>> tmp_path = getfixture('tmp_path')
>>> with pushd(tmp_path):
... assert os.getcwd() == os.fspath(tmp_path)
>>> assert os.getcwd() != os.fspath(tmp_path)
"""

orig = os.getcwd()
os.chdir(dir)
try:
Expand Down

0 comments on commit 9c1a7ea

Please sign in to comment.