X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f69e114cf6dbe51525e98ca30a52ef3dd4341167..b13876638cf57b400bd59513a0a1811b3d2993a1:/sdk/python/tests/test_arv_ws.py diff --git a/sdk/python/tests/test_arv_ws.py b/sdk/python/tests/test_arv_ws.py index 4a0b8238a7..521c46ee34 100644 --- a/sdk/python/tests/test_arv_ws.py +++ b/sdk/python/tests/test_arv_ws.py @@ -1,7 +1,8 @@ -#!/usr/bin/env python +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 from __future__ import absolute_import -import io import os import sys import tempfile @@ -11,7 +12,7 @@ import arvados.errors as arv_error import arvados.commands.ws as arv_ws from . import arvados_testutil as tutil -class ArvWsTestCase(unittest.TestCase): +class ArvWsTestCase(unittest.TestCase, tutil.VersionChecker): def run_ws(self, args): return arv_ws.main(args) @@ -20,10 +21,8 @@ class ArvWsTestCase(unittest.TestCase): self.run_ws(['-x=unknown']) def test_version_argument(self): - err = io.BytesIO() - out = io.BytesIO() - with tutil.redirected_streams(stdout=out, stderr=err): + with tutil.redirected_streams( + stdout=tutil.StringIO, stderr=tutil.StringIO) as (out, err): with self.assertRaises(SystemExit): self.run_ws(['--version']) - self.assertEqual(out.getvalue(), '') - self.assertRegexpMatches(err.getvalue(), "[0-9]+\.[0-9]+\.[0-9]+") + self.assertVersionOutput(out, err)