Commit c22fb3cb authored by Guido Günther's avatar Guido Günther

Ignore return types of write and shutil.copy

Python3 does not return None anymore
parent f1f37b96
......@@ -84,7 +84,7 @@ class DebianSourceFormat(object):
>>> import tempfile, os
>>> with tempfile.NamedTemporaryFile(delete=False) as t:
... t.write("3.0 (quilt)")
... ret = t.write("3.0 (quilt)")
>>> d = DebianSourceFormat.parse_file(t.name)
>>> d.version
'3.0'
......
......@@ -237,7 +237,7 @@ def test_add_section():
>>> testclname = os.path.join(testdebdir, "changelog")
>>> os.mkdir(testdebdir)
>>> clh = open(os.path.join(testdebdir, "changelog"), "w")
>>> clh.write(cl_debian)
>>> ret = clh.write(cl_debian)
>>> clh.close()
>>> os.chdir(testdir)
>>> os.path.abspath(os.path.curdir) == testdir
......@@ -283,7 +283,7 @@ def test_add_entry():
>>> testclname = os.path.join(testdebdir, "changelog")
>>> os.mkdir(testdebdir)
>>> clh = open(os.path.join(testdebdir, "changelog"), "w")
>>> clh.write(cl_debian)
>>> ret = clh.write(cl_debian)
>>> clh.close()
>>> os.chdir(testdir)
>>> os.path.abspath(os.path.curdir) == testdir
......
......@@ -68,14 +68,14 @@ def test_filter():
>>> tmpdir = str(context.new_tmpdir('bar'))
>>> confname = os.path.join(tmpdir, 'gbp.conf')
>>> f = open(confname, 'w')
>>> f.write('[bar]\\nfilter = asdf\\n')
>>> ret = f.write('[bar]\\nfilter = asdf\\n')
>>> f.close()
>>> os.environ['GBP_CONF_FILES'] = confname
>>> parser = GbpOptionParser('bar')
>>> parser.config['filter']
['asdf']
>>> f = open(confname, 'w')
>>> f.write("[bar]\\nfilter = ['this', 'is', 'a', 'list']\\n")
>>> ret = f.write("[bar]\\nfilter = ['this', 'is', 'a', 'list']\\n")
>>> f.close()
>>> parser = GbpOptionParser('bar')
>>> parser.config['filter']
......
......@@ -74,8 +74,8 @@ def test_add_files():
>>> import gbp.git, shutil, os
>>> repo = gbp.git.GitRepository(repo_dir)
>>> shutil.copy(os.path.join(repo.path, ".git/HEAD"), \
os.path.join(repo.path, "testfile"))
>>> ret = shutil.copy(os.path.join(repo.path, ".git/HEAD"),
... os.path.join(repo.path, "testfile"))
>>> repo.is_clean()[0]
False
>>> repo.is_clean(ignore_untracked=True)[0]
......@@ -113,8 +113,8 @@ def test_clean():
>>> import gbp.git, shutil, os
>>> repo = gbp.git.GitRepository(repo_dir)
>>> shutil.copy(os.path.join(repo.path, ".git/HEAD"), \
os.path.join(repo.path, "testclean"))
>>> ret = shutil.copy(os.path.join(repo.path, ".git/HEAD"),
... os.path.join(repo.path, "testclean"))
>>> repo.clean(dry_run=True)
>>> repo.is_clean()[0]
False
......@@ -202,7 +202,7 @@ def test_set_upstream_branch():
>>> import gbp.git
>>> repo = gbp.git.GitRepository(repo_dir)
>>> os.makedirs(os.path.join(repo.git_dir, 'refs/remotes/origin'))
>>> shutil.copy(os.path.join(repo.git_dir, 'refs/heads/master'), \
>>> ret = shutil.copy(os.path.join(repo.git_dir, 'refs/heads/master'), \
os.path.join(repo.git_dir, 'refs/remotes/origin/'))
>>> repo.add_remote_repo('origin', 'git://git.example.com/git/origin')
>>> repo.set_upstream_branch('master', 'origin/master')
......@@ -387,7 +387,7 @@ def test_list_files():
[]
>>> repo.list_files(['modified', 'deleted', 'cached'])
['testfile']
>>> shutil.copy(src, dst)
>>> ret = shutil.copy(src, dst)
>>> repo.list_files(['modified'])
['testfile']
>>> repo.add_files(dst)
......@@ -401,7 +401,7 @@ def test_list_files():
>>> repo.force_head('HEAD^', hard=True)
>>> repo.list_files(['modified'])
[]
>>> shutil.copy(src, dst)
>>> ret = shutil.copy(src, dst)
>>> repo.list_files(['modified'])
['testfile']
>>> repo.commit_files(dst, msg="foo")
......@@ -889,7 +889,7 @@ def test_status():
>>> import gbp.git, os, shutil
>>> repo = gbp.git.GitRepository(repo_dir)
>>> fname = os.path.join(repo.path, "test_status")
>>> shutil.copy(os.path.join(repo.path, ".git/HEAD"), fname)
>>> ret = shutil.copy(os.path.join(repo.path, ".git/HEAD"), fname)
>>> repo.status().items()
[('??', ['test_status'])]
>>> repo.status(['bla*']).items()
......
......@@ -28,7 +28,7 @@ def test_read():
>>> repo = gbp.git.GitRepository.create(str(repo_dir))
>>> f = open(os.path.join(repo.path, 'foo.txt'), 'w')
>>> content = 'al pha\\na\\nb\\nc'
>>> f.write('al pha\\na\\nb\\nc')
>>> ret = f.write('al pha\\na\\nb\\nc')
>>> f.close()
>>> repo.add_files(repo.path, force=True)
>>> repo.commit_all(msg="foo")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment