diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -2006,6 +2006,22 @@ finally: support.unlink(tar_name) + def test_create_command_filetype(self): + files = [support.findfile('tokenize_tests.txt'), + support.findfile('tokenize_tests-no-coding-cookie-' + 'and-utf8-bom-sig-only.txt')] + + for filetype in (GzipTest, Bz2Test, LzmaTest): + if not filetype.open: + continue + try: + filename = tmpname + '.' + filetype.suffix + out = self.tarfilecmd('-c', filename, *files) + with filetype.taropen(filename, 'r') as tar: + pass + finally: + support.unlink(filename) + def test_extract_command(self): self.make_simple_tarfile(tmpname) for opt in '-e', '--extract':