Skip to content

Commit

Permalink
Use pushd from twitter.common.contextutil.
Browse files Browse the repository at this point in the history
  • Loading branch information
amerkel2 committed Mar 14, 2016
1 parent 70b3748 commit 0984685
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ atlassian-ide-plugin.xml
venv*/
build
tests/fixture/package/dist
dist/

README.html
17 changes: 3 additions & 14 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
import os
from contextlib import contextmanager
import requests
from twitter.common.contextutil import pushd
from unittest import TestCase

import requests
from devpi_plumber.client import DevpiClientError, volatile_index
from devpi_plumber.server import TestServer


@contextmanager
def cd(path):
old_dir = os.getcwd()
os.chdir(path)
try:
yield
finally:
os.chdir(old_dir)


class ClientTest(TestCase):
"""
Assert that the plumber devpi client behaves as expected.
Expand Down Expand Up @@ -139,7 +128,7 @@ def test_upload_with_docs(self):
with TestServer(users, indices) as devpi:
devpi.login("user", "secret")
devpi.use("user/index")
with cd('tests/fixture/package'):
with pushd('tests/fixture/package'):
devpi.upload(with_docs=True)

def test_list_existing_package(self):
Expand Down

0 comments on commit 0984685

Please sign in to comment.