summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-05-21 11:47:44 -0400
committerJason R. Coombs <jaraco@jaraco.com>2017-05-21 11:52:32 -0400
commit8d3ed39696c5932a48b5f4a3768caa9f9e8c54b8 (patch)
treeb1738b2501cc04fa618a4cc26975543b11572713
parent20567bef2a36b259d2209cc76fd11a61ad288853 (diff)
downloadpython-setuptools-git-8d3ed39696c5932a48b5f4a3768caa9f9e8c54b8.tar.gz
Just use class in its namespace
-rw-r--r--setuptools/tests/test_sandbox.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py
index 6b0400f3..a3f1206d 100644
--- a/setuptools/tests/test_sandbox.py
+++ b/setuptools/tests/test_sandbox.py
@@ -7,12 +7,11 @@ import pytest
import pkg_resources
import setuptools.sandbox
-from setuptools.sandbox import DirectorySandbox
class TestSandbox:
def test_devnull(self, tmpdir):
- with DirectorySandbox(str(tmpdir)):
+ with setuptools.sandbox.DirectorySandbox(str(tmpdir)):
self._file_writer(os.devnull)
@staticmethod
@@ -116,11 +115,11 @@ class TestExceptionSaver:
with open('/etc/foo', 'w'):
pass
- sandbox = DirectorySandbox(str(tmpdir))
with pytest.raises(setuptools.sandbox.SandboxViolation) as caught:
with setuptools.sandbox.save_modules():
setuptools.sandbox.hide_setuptools()
- sandbox.run(write_file)
+ with setuptools.sandbox.DirectorySandbox(str(tmpdir)):
+ write_file()
cmd, args, kwargs = caught.value.args
assert cmd == 'open'