Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pytest-capturelog from testing requirements #730

Merged
merged 1 commit into from
Nov 10, 2022

Conversation

kbriggs
Copy link
Contributor

@kbriggs kbriggs commented Nov 10, 2022

The pytest-capturelog plugin no longer exists; its functionality has been merged into the pytest core since ~3.3. Remove the dependency.

Fixes #729

The pytest-capturelog plugin no longer exists; its functionality has
been merged into the pytest core since ~3.3. Remove the dependency.

Fixes pexpect#729
@kbriggs
Copy link
Contributor Author

kbriggs commented Nov 10, 2022

Before:

 % virtualenv venv2
created virtual environment CPython3.6.9.final.0-64 in 3587ms
<…>
 % . venv2/bin/activate
 % pip3 install -e .
<…>
Successfully installed pexpect-4.8.0 ptyprocess-0.7.0
 % pip3 install -r requirements-testing.txt
<…>
ERROR: Could not find a version that satisfies the requirement pytest-capturelog (from versions: none)
ERROR: No matching distribution found for pytest-capturelog
 % py.test
zsh: command not found: py.test

After:

 % pip3 install -r requirements-testing.txt
<…>
Installing collected packages: zipp, typing-extensions, pyparsing, importlib-metadata, urllib3, tomli, py, pluggy, packaging, iniconfig, idna, coverage, charset-normalizer, certifi, attrs, requests, pytest, docopt, pytest-cov, coveralls
Successfully installed attrs-22.1.0 certifi-2022.9.24 charset-normalizer-2.0.12 coverage-6.2 coveralls-3.3.1 docopt-0.6.2 idna-3.4 importlib-metadata-4.8.3 iniconfig-1.1.1 packaging-21.3 pluggy-1.0.0 py-1.11.0 pyparsing-3.0.9 pytest-7.0.1 pytest-cov-4.0.0 requests-2.27.1 tomli-1.2.3 typing-extensions-4.1.1 urllib3-1.26.12 zipp-3.6.0
 % py.test
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-7.0.1, pluggy-1.0.0
rootdir: /ifs/home/kbriggs/Projects/misc/pexpect, configfile: setup.cfg
plugins: cov-4.0.0
collected 242 items

tests/test_FSM.py .                                                      [  0%]
tests/test_ansi.py .........                                             [  4%]
tests/test_async.py .........                                            [  7%]
tests/test_command_list_split.py .                                       [  8%]
tests/test_constructor.py ..                                             [  9%]
tests/test_ctrl_chars.py .....                                           [ 11%]
tests/test_delay.py ..                                                   [ 11%]
tests/test_destructor.py .                                               [ 12%]
tests/test_dotall.py ..                                                  [ 13%]
tests/test_env.py ....                                                   [ 14%]
tests/test_expect.py ........................................            [ 31%]
tests/test_filedescriptor.py .....                                       [ 33%]
tests/test_interact.py ...                                               [ 34%]
tests/test_isalive.py .........                                          [ 38%]
tests/test_log.py ....                                                   [ 40%]
tests/test_misc.py ..............................                        [ 52%]
tests/test_missing_command.py .                                          [ 52%]
tests/test_performance.py ..                                             [ 53%]
tests/test_pickling.py .                                                 [ 54%]
tests/test_popen_spawn.py ...........                                    [ 58%]
tests/test_pxssh.py .....................                                [ 67%]
tests/test_replwrap.py F........                                         [ 71%]
tests/test_repr.py ...                                                   [ 72%]
tests/test_run.py .................                                      [ 79%]
tests/test_screen.py ...........                                         [ 83%]
tests/test_socket.py .............                                       [ 89%]
tests/test_timeout_pattern.py .....                                      [ 91%]
tests/test_unicode.py ...........                                        [ 95%]
tests/test_which.py .......                                              [ 98%]
tests/test_winsize.py ...                                                [100%]

=================================== FAILURES ===================================
__________________________ REPLWrapTestCase.test_bash __________________________

self = <tests.test_replwrap.REPLWrapTestCase testMethod=test_bash>

    def test_bash(self):
        bash = replwrap.bash()
        res = bash.run_command("alias")
>       assert 'alias' in res, res
E       AssertionError:
E       assert 'alias' in ''

/ifs/home/kbriggs/Projects/misc/pexpect/tests/test_replwrap.py:29: AssertionError
=============================== warnings summary ===============================
pexpect/ANSI.py:29
  /ifs/home/kbriggs/Projects/misc/pexpect/pexpect/ANSI.py:29: UserWarning: pexpect.screen and pexpect.ANSI are deprecated. We recommend using pyte to emulate a terminal screen: https://pypi.python.org/pypi/pyte
    from . import screen

tests/test_expect.py::ExpectTestCase::test_bad_arg
  /ifs/home/kbriggs/Projects/misc/pexpect/tests/test_expect.py:646: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(TypeError, '.*must be one of'):

tests/test_expect.py::ExpectTestCase::test_bad_arg
  /ifs/home/kbriggs/Projects/misc/pexpect/tests/test_expect.py:648: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(TypeError, '.*must be one of'):

tests/test_expect.py::ExpectTestCase::test_bad_arg
  /ifs/home/kbriggs/Projects/misc/pexpect/tests/test_expect.py:650: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(TypeError, '.*must be one of'):

tests/test_expect.py::ExpectTestCase::test_bad_arg
  /ifs/home/kbriggs/Projects/misc/pexpect/tests/test_expect.py:652: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(TypeError, '.*must be one of'):

tests/test_misc.py::TestCaseMisc::test_bad_arguments_suggest_fdpsawn
  /ifs/home/kbriggs/Projects/misc/pexpect/tests/test_misc.py:228: DeprecationWarning: Please use assertRaisesRegex instead.
    ".*" + expect_errmsg):

tests/test_misc.py::TestCaseMisc::test_bad_child_pid
  /ifs/home/kbriggs/Projects/misc/pexpect/tests/test_misc.py:218: DeprecationWarning: Please use assertRaisesRegex instead.
    ".*" + expect_errmsg):

tests/test_popen_spawn.py::ExpectTestCase::test_bad_arg
  /ifs/home/kbriggs/Projects/misc/pexpect/tests/test_popen_spawn.py:113: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(TypeError, '.*must be one of'):

tests/test_popen_spawn.py::ExpectTestCase::test_bad_arg
  /ifs/home/kbriggs/Projects/misc/pexpect/tests/test_popen_spawn.py:115: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(TypeError, '.*must be one of'):

tests/test_popen_spawn.py::ExpectTestCase::test_bad_arg
  /ifs/home/kbriggs/Projects/misc/pexpect/tests/test_popen_spawn.py:117: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(TypeError, '.*must be one of'):

tests/test_popen_spawn.py::ExpectTestCase::test_bad_arg
  /ifs/home/kbriggs/Projects/misc/pexpect/tests/test_popen_spawn.py:119: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(TypeError, '.*must be one of'):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_replwrap.py::REPLWrapTestCase::test_bash - AssertionError:
============ 1 failed, 241 passed, 11 warnings in 212.93s (0:03:32) ============

(there is a failure in test_replwrap.REPLWrapTestCase and a number of DeprecationWarnings; these are all pre-existing).

@Red-M
Copy link
Member

Red-M commented Nov 10, 2022

This seems to have been renamed as per pypa/packaging-problems#423
The new name is pytest-catchlog

@Red-M
Copy link
Member

Red-M commented Nov 10, 2022

Oops I only read about that deprecation now, ignore me, this is fine.

@Red-M Red-M merged commit 2e003ef into pexpect:master Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pytest-capturelog no longer exists
2 participants