diff options
author | Matt Clay <matt@mystile.com> | 2023-02-01 16:00:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-01 16:00:57 -0800 |
commit | 91807695c363c765197a982a0266ed3d59e3fac5 (patch) | |
tree | f7224bbed3c65afa82e53a5fe3218123d2a3fb49 /test/units/mock/procenv.py | |
parent | 0a53309f47a7fe914f6b2ac65fc2af149b9cd2ad (diff) | |
download | ansible-91807695c363c765197a982a0266ed3d59e3fac5.tar.gz |
Remove unused unit test code (#79879)
* Remove unused test fixtures
* Removed unused _old_dump_load_cycle method
* Remove Python 2.x compat
* Remove unused code
* Remove unused context manager
* Fix cowsay test
- The test no longer depends on another test to initialize config.
- Also remove unreachable code.
* Remove Python 2.x compat
Diffstat (limited to 'test/units/mock/procenv.py')
-rw-r--r-- | test/units/mock/procenv.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/test/units/mock/procenv.py b/test/units/mock/procenv.py index 271a207e2e..7a61bfc37c 100644 --- a/test/units/mock/procenv.py +++ b/test/units/mock/procenv.py @@ -54,26 +54,6 @@ def swap_stdin_and_argv(stdin_data='', argv_data=tuple()): sys.argv = real_argv -@contextmanager -def swap_stdout(): - """ - context manager that temporarily replaces stdout for tests that need to verify output - """ - old_stdout = sys.stdout - - if PY3: - fake_stream = StringIO() - else: - fake_stream = BytesIO() - - try: - sys.stdout = fake_stream - - yield fake_stream - finally: - sys.stdout = old_stdout - - class ModuleTestCase(unittest.TestCase): def setUp(self, module_args=None): if module_args is None: |