def test_working_directory_shell(self):
     cache = ProgramOutputCache()
     cwd = os.path.join(self.tmpdir, 'wd')
     os.mkdir(cwd)
     cwd = os.path.realpath(os.path.normpath(str(cwd)))
     cmd = Command('echo $PWD', working_directory=cwd, shell=True)
     self.assert_cache(cache, cmd, cwd)
예제 #2
0
 def test_working_directory(self):
     cache = ProgramOutputCache()
     cwd = os.path.join(self.tmpdir, 'wd')
     os.mkdir(cwd)
     cwd = os.path.realpath(os.path.normpath(str(cwd)))
     cmd = ['python', '-c', 'import sys, os; sys.stdout.write(os.getcwd())']
     self.assert_cache(cache, Command(cmd, working_directory=cwd), cwd)
 def test_nonzero_return_code_shell(self):
     cache = ProgramOutputCache()
     cmd = sys.executable + " -c 'import sys; sys.exit(1)'"
     self.assert_cache(cache, Command(cmd, shell=True), '', returncode=1)
 def test_nonzero_return_code(self):
     cache = ProgramOutputCache()
     cmd = [sys.executable, '-c', 'import sys; sys.exit(1)']
     self.assert_cache(cache, Command(cmd), '', returncode=1)
 def test_hidden_standard_error(self):
     cache = ProgramOutputCache()
     cmd = [sys.executable, '-c', 'import sys; sys.stderr.write("spam")']
     self.assert_cache(cache, Command(cmd, hide_standard_error=True), '')
 def test_shell(self):
     cache = ProgramOutputCache()
     self.assert_cache(cache, Command(u'echo blök', shell=True), u'blök')
 def test_simple(self):
     cache = ProgramOutputCache()
     self.assert_cache(cache, Command([u'echo', u'blök']), u'blök')
def pytest_funcarg__cache(request):
    return ProgramOutputCache()
예제 #9
0
def pytest_funcarg__cache(request):  # pylint: disable=W0613
    return ProgramOutputCache()