GithubHelp home page GithubHelp logo

freakboy3742 / pytest-tldr Goto Github PK

View Code? Open in Web Editor NEW
88.0 4.0 4.0 171 KB

A pytest plugin that limits the output to just the things you need.

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

pytest-tldr's Introduction

pytest-tldr

PyPI version

Python versions

License

Build Status

A pytest plugin that limits the output of pytest to just the things you need to see.

One of my biggest personal complaints about pytest is that its console output is very, very chatty. It tells you it's starting. It tells you it's working. It tells you it's done. And if a test fails, it doesn't just tell you which test failed. It dumps pages and pages of code onto your console.

And it does all this in Glorious Technicolor. Better hope you have perfect color vision, and your console color choices are contrast compatible.

Yes: pytest has many, many command line options. And some of these behaviors can be configured or turned off with feature flags. But there are some people (presumably, at the very least, the pytest core team) who like pytest's output format. So if you're the odd-one-out on a team who doesn't like pytest's output, you can't commit "better" options into a default configuration - you have to manually specify your options every time you run the test suite.

Luckily, pytest also has a plugin system, so we can fix this.

pytest-tldr is plugin that gives you minimalist output, in monochrome, while still giving an indication of test suite progress.

Installation

You can install "pytest-tldr" via pip from PyPI:

$ pip install pytest-tldr

Then you can just run your test suite as normal:

$ pytest tests
EF..s..........ux
======================================================================
ERROR: tests/test_things.py::TestTests::test_error
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rkm/projects/sample/tests/test_things.py", line 182, in test_error
    raise Exception("this is really bad")
Exception: this is really bad

======================================================================
FAIL: tests/test_things.py::TestTests::test_failed
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rkm/projects/sample/tests/test_things.py", line 179, in test_failed
    self.fail('failed!')
  File "/Users/rkm/.pyenv/versions/3.6.2/lib/python3.6/unittest/case.py", line 670, in fail
    raise self.failureException(msg)
AssertionError: failed!

======================================================================
UNEXPECTED SUCCESS: tests/test_things.py::TestTests::test_upassed

----------------------------------------------------------------------
Ran 17 tests in 2.11s

FAILED (errors=1, failures=1, skipped=1, expected failures=1, unexpected successes=1)

Or, if you need a little more detail, use the verbosity option:

$ pytest tests -v
platform darwin -- Python 3.6.2
pytest==3.6.1
py==1.5.2
pluggy==0.6.0
rootdir: /Users/rkm/projects/sample
plugins: xdist-1.22.0, forked-0.2, tldr-0.1.0
cachedir: .pytest_cache

----------------------------------------------------------------------
tests/test_things.py::TestTests::test_error ... ERROR
tests/test_things.py::TestTests::test_failed ... FAIL
tests/test_things.py::TestTests::test_output ... ok
tests/test_things.py::TestTests::test_passed ... ok
tests/test_things.py::TestTests::test_skipped ... Skipped: tra-la-la
tests/test_things.py::TestTests::test_thing_0 ... ok
tests/test_things.py::TestTests::test_thing_1 ... ok
tests/test_things.py::TestTests::test_thing_2 ... ok
tests/test_things.py::TestTests::test_thing_3 ... ok
tests/test_things.py::TestTests::test_thing_4 ... ok
tests/test_things.py::TestTests::test_thing_5 ... ok
tests/test_things.py::TestTests::test_thing_6 ... ok
tests/test_things.py::TestTests::test_thing_7 ... ok
tests/test_things.py::TestTests::test_thing_8 ... ok
tests/test_things.py::TestTests::test_thing_9 ... ok
tests/test_things.py::TestTests::test_upassed ... unexpected success
tests/test_things.py::TestTests::test_xfailed ... expected failure

======================================================================
ERROR: tests/test_things.py::TestTests::test_error
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rkm/projects/sample/tests/test_things.py", line 182, in test_error
    raise Exception("this is really bad")
Exception: this is really bad

======================================================================
FAIL: tests/test_things.py::TestTests::test_failed
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rkm/projects/sample/tests/test_things.py", line 179, in test_failed
    self.fail('failed!')
  File "/Users/rkm/.pyenv/versions/3.6.2/lib/python3.6/unittest/case.py", line 670, in fail
    raise self.failureException(msg)
AssertionError: failed!

======================================================================
UNEXPECTED SUCCESS: tests/test_things.py::TestTests::test_upassed

----------------------------------------------------------------------
Ran 17 tests in 2.07s

FAILED (errors=1, failures=1, skipped=1, expected failures=1, unexpected successes=1)

pytest-tldr's People

Contributors

freakboy3742 avatar jacebrowning avatar tonybaloney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pytest-tldr's Issues

0.2.3 no longer compatible with pytest <=5.x

$ pip install pytest==5.4.3
$ pip install pytest-tldr
$ echo "def test_foo():
    asssert True
" > tests.py
$ pytest
Traceback (most recent call last):
  File "/home/blaxter/.virtualenvs/test/bin/pytest", line 8, in <module>
    sys.exit(main())
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/_pytest/config/__init__.py", line 124, in main
    ret = config.hook.pytest_cmdline_main(
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/_pytest/main.py", line 240, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/_pytest/main.py", line 228, in wrap_session
    config.hook.pytest_sessionfinish(
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pytest_tldr.py", line 277, in pytest_sessionfinish
    self.print()
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/pytest_tldr.py", line 119, in print
    self._tw.write(end, flush=flush)
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/py/_io/terminalwriter.py", line 253, in write
    markupmsg = self.markup(msg, **kw)
  File "/home/blaxter/.virtualenvs/test/lib/python3.8/site-packages/py/_io/terminalwriter.py", line 209, in markup
    raise ValueError("unknown markup: %r" %(name,))
ValueError: unknown markup: 'flush'

hookspec UserWarning on use

I tried out using pytest-tldr on Python 3.7 and it worked, but produced an odd warning:

/usr/local/lib/python3.7/site-packages/pytest_tldr.py:282: UserWarning: Argument(s) ('config',) which are declared in the hookspec can not be found in this hook call terminalreporter=self, exitstatus=exitstatus

Is this a bug?

Improve configurability of verbosity behavior

Hello! My team loves pytest-tldr, but we recently ran into some issues where diff truncation in the non-verbose output of pytest was interfering with debugging flaky tests. We want a way to have the tldr functionality, but have verbose output for fail/error/unexpected pass reports.

I was able to get this functionality by ripping out the "verbosity" sensitivity from pytest-tldr all together, and then running pytest in verbose mode. The blunt force version is forked on my github account.

If I were to clean this up (read: restore original functionality and make it configurable) would you consider accepting a PR to add this mode?

Thanks for your work!

Enable TLDR with a flag?

Hi there,
This is a great plugin! Is there a way to either enable the plugin with a flag (e.g. pytest --tldr) or alternatively disable it with a flag (e.g. pytest --no-tldr) while it is installed?

It would be nice to have the option to look at the TLDR output during test development, and complete (e.g. native pytest, or even pytest-sugar or pytest-cov) output in other cases such as in a CI dashboard, as sometimes the additional context there in the default/sugared output is helpful.

Ideally in order to play nicely with other plugins that may be installed, it would be great if config could be specified in setup.cfg to indicate whether TLDR should be enabled or disabled in a default pytest invocation, and then the flags --tldr and --no-tldr could toggle it at runtime, depending on the default value.

Suppresses Collection Errors

When there is an error in Test Collections such as SyntaxError, it would be nice to be reminded of that.

Basically, shows

----------------------------------------------------------------------
Ran 0 tests

OK

when running pytest with syntax error code such as print 'hello' in python3.

Support Python2

When running with Python 2.7.15 I get:

$ pytest
Traceback (most recent call last):
  File "/home/daonb/src/matific/SlateMathWeb/env/bin/pytest", line 11, in <module>
    sys.exit(main())
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/_pytest/config.py", line 52, in main
    config = _prepareconfig(args, plugins)
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/_pytest/config.py", line 163, in _prepareconfig
    pluginmanager=pluginmanager, args=args)
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/pluggy/__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/pluggy/__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/pluggy/__init__.py", line 216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/pluggy/callers.py", line 196, in _multicall
    gen.send(outcome)
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/_pytest/helpconfig.py", line 68, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/pluggy/callers.py", line 77, in get_result
    _reraise(*ex)  # noqa
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/_pytest/config.py", line 936, in pytest_cmdline_parse
    self.parse(args)
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/_pytest/config.py", line 1086, in parse
    self._preparse(args, addopts=addopts)
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/_pytest/config.py", line 1048, in _preparse
    self.pluginmanager.load_setuptools_entrypoints('pytest11')
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/pluggy/__init__.py", line 397, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2318, in load
    return self.resolve()
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2324, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/daonb/src/matific/SlateMathWeb/env/local/lib/python2.7/site-packages/pytest_tldr.py", line 55
    def print(self, *args, **kwargs):
            ^
SyntaxError: invalid syntax
$ pip freeze | grep pytest
pytest==3.5.0
pytest-django==3.1.2
pytest-forked==0.2
pytest-tldr==0.1.1
pytest-watch==4.1.0
pytest-xdist==1.21.0

No write to terminal,

With pytest-tldr==0.2.2 and pytest==6.0.1, I'm seeing behaviour that turns up no output in the terminal at all, until either the tests are completed or I abort the test process โ€“ then, all collected output is printed at once. (FWIW, this doesn't happen with pytest-sugar)

Conflict with pytest-json

I'm not sure if this is a bug in pytest-json or pytest-tldr:

Traceback (most recent call last):
  File ".../bin/pytest", line 11, in <module>
    sys.exit(main())
  File ".../lib/python3.7/site-packages/_pytest/config/__init__.py", line 64, in main
    return config.hook.pytest_cmdline_main(config=config)
  File ".../lib/python3.7/site-packages/pluggy/__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File ".../lib/python3.7/site-packages/pluggy/__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File ".../lib/python3.7/site-packages/pluggy/__init__.py", line 216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File ".../lib/python3.7/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File ".../lib/python3.7/site-packages/pluggy/callers.py", line 76, in get_result
    raise ex[1].with_traceback(ex[2])
  File ".../lib/python3.7/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File ".../lib/python3.7/site-packages/_pytest/main.py", line 208, in pytest_cmdline_main
    return wrap_session(config, _main)
  File ".../lib/python3.7/site-packages/_pytest/main.py", line 178, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File ".../lib/python3.7/site-packages/pluggy/__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File ".../lib/python3.7/site-packages/pluggy/__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File ".../lib/python3.7/site-packages/pluggy/__init__.py", line 216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File ".../lib/python3.7/site-packages/pluggy/callers.py", line 201, in _multicall
    return outcome.get_result()
  File ".../lib/python3.7/site-packages/pluggy/callers.py", line 76, in get_result
    raise ex[1].with_traceback(ex[2])
  File ".../lib/python3.7/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File ".../lib/python3.7/site-packages/pytest_tldr.py", line 282, in pytest_sessionfinish
    terminalreporter=self, exitstatus=exitstatus
  File ".../lib/python3.7/site-packages/pluggy/__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File ".../lib/python3.7/site-packages/pluggy/__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File ".../lib/python3.7/site-packages/pluggy/__init__.py", line 216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File ".../lib/python3.7/site-packages/pluggy/callers.py", line 201, in _multicall
    return outcome.get_result()
  File ".../lib/python3.7/site-packages/pluggy/callers.py", line 76, in get_result
    raise ex[1].with_traceback(ex[2])
  File ".../lib/python3.7/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File ".../lib/python3.7/site-packages/pytest_jsonreport/plugin.py", line 136, in pytest_terminal_summary
    terminalreporter.write_sep('-', 'JSON report')
AttributeError: 'TLDRReporter' object has no attribute 'write_sep'

`AttributeError` for `pytest v7.2.0`

Failing CI for beeware/briefcase#943 is suggesting pytest-tldr needs updates to continue working with pytest>=7.2.0.

11s
Run tox -e py --installpkg dist/*.whl
  tox -e py --installpkg dist/*.whl
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    python_version: 3.9
    pythonLocation: /opt/hostedtoolcache/Python/3.[1](https://github.com/beeware/briefcase/actions/runs/3324020664/jobs/5495092973#step:6:1)0.8/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.8/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.8/x64
    Python[2](https://github.com/beeware/briefcase/actions/runs/3324020664/jobs/5495092973#step:6:2)_ROOT_DIR: /opt/hostedtoolcache/Python/[3](https://github.com/beeware/briefcase/actions/runs/3324020664/jobs/5495092973#step:6:3).10.8/x6[4](https://github.com/beeware/briefcase/actions/runs/3324020664/jobs/5495092973#step:6:4)
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.8/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.8/x64/lib
py create: /home/runner/work/briefcase/briefcase/.tox/py
py inst: /home/runner/work/briefcase/briefcase/.tox/.tmp/package/1/briefcase-0.3.12.dev[5](https://github.com/beeware/briefcase/actions/runs/3324020664/jobs/5495092973#step:6:5)1+gd4888321-py3-none-any.whl
py installed: arrow==1.2.3,attrs==22.1.0,binaryornot==0.4.4,briefcase @ file:///home/runner/work/briefcase/briefcase/.tox/.tmp/package/1/briefcase-0.3.12.dev51%2Bgd4888321-py3-none-any.whl,certifi==2022.9.24,chardet==5.0.0,charset-normalizer==2.1.1,click==8.1.3,commonmark==0.9.1,cookiecutter==2.1.1,coverage==[6](https://github.com/beeware/briefcase/actions/runs/3324020664/jobs/5495092973#step:6:6).5.0,exceptiongroup==1.0.0rc9,gitdb==4.0.9,GitPython==3.1.29,idna==3.4,iniconfig==1.1.1,Jinja2==3.1.2,jinja2-time==0.2.0,MarkupSafe==2.1.1,packaging==21.3,platformdirs==2.5.2,pluggy==1.0.0,psutil==5.9.3,Pygments==2.13.0,pyparsing==3.0.9,pytest==[7](https://github.com/beeware/briefcase/actions/runs/3324020664/jobs/5495092973#step:6:7).2.0,pytest-cov==4.0.0,pytest-tldr==0.2.4,python-dateutil==2.[8](https://github.com/beeware/briefcase/actions/runs/3324020664/jobs/5495092973#step:6:8).2,python-slugify==6.1.2,PyYAML==6.0,requests==2.28.1,rich==12.6.0,six==1.16.0,smmap==5.0.0,text-unidecode==1.3,tomli==2.0.1,tomli_w==1.0.0,urllib3==1.26.12
py run-test-pre: PYTHONHASHSEED='420284[9](https://github.com/beeware/briefcase/actions/runs/3324020664/jobs/5495092973#step:6:9)385'
py run-test: commands[0] | python -m coverage run -m pytest -vv
platform linux -- Python 3.[10](https://github.com/beeware/briefcase/actions/runs/3324020664/jobs/5495092973#step:6:10).8
pytest==7.2.0

INTERNALERROR> Traceback (most recent call last):

INTERNALERROR>   File "/home/runner/work/briefcase/briefcase/.tox/py/lib/python3.10/site-packages/_pytest/main.py", line 268, in wrap_session

INTERNALERROR>     config.hook.pytest_sessionstart(session=session)

INTERNALERROR>   File "/home/runner/work/briefcase/briefcase/.tox/py/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__

INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)

INTERNALERROR>   File "/home/runner/work/briefcase/briefcase/.tox/py/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec

INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)

INTERNALERROR>   File "/home/runner/work/briefcase/briefcase/.tox/py/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall

INTERNALERROR>     return outcome.get_result()

INTERNALERROR>   File "/home/runner/work/briefcase/briefcase/.tox/py/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result

INTERNALERROR>     raise ex[1].with_traceback(ex[2])

INTERNALERROR>   File "/home/runner/work/briefcase/briefcase/.tox/py/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall

INTERNALERROR>     res = hook_impl.function(*args)

INTERNALERROR>   File "/home/runner/work/briefcase/briefcase/.tox/py/lib/python3.10/site-packages/pytest_tldr.py", line [15](https://github.com/beeware/briefcase/actions/runs/3324020664/jobs/5495092973#step:6:16)5, in pytest_sessionstart

INTERNALERROR>     self.print("py=={}".format(py.__version__))

INTERNALERROR> AttributeError: module 'py' has no attribute '__version__'
ERROR: InvocationError for command /home/runner/work/briefcase/briefcase/.tox/py/bin/python -m coverage run -m pytest -vv (exited with code 3)
___________________________________ summary ____________________________________
ERROR:   py: commands failed
Error: Process completed with exit code 1.

This seems like the likely source (from 7.2.0 release notes):

pytest-dev/pytest#10396: pytest no longer depends on the py library. pytest provides a vendored copy of py.error and py.path modules but will use the py library if it is installed. If you need other py.* modules, continue to install the deprecated py library separately, otherwise it can usually be removed as a dependency.

AttributeError after installing

I get the following error after installing:

$ pytest
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/poswald/Projects/myproj/env/lib/python3.6/site-packages/_pytest/main.py", line 174, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/Users/poswald/Projects/myproj/env/lib/python3.6/site-packages/_pytest/config.py", line 957, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/Users/poswald/Projects/myproj/env/lib/python3.6/site-packages/pluggy/__init__.py", line 628, in call_historic
INTERNALERROR>     res = self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/Users/poswald/Projects/myproj/env/lib/python3.6/site-packages/pluggy/__init__.py", line 222, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/poswald/Projects/myproj/env/lib/python3.6/site-packages/pluggy/__init__.py", line 216, in <lambda>
INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR>   File "/Users/poswald/Projects/myproj/env/lib/python3.6/site-packages/pluggy/callers.py", line 201, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/poswald/Projects/myproj/env/lib/python3.6/site-packages/pluggy/callers.py", line 76, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/poswald/Projects/myproj/env/lib/python3.6/site-packages/pluggy/callers.py", line 180, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/poswald/Projects/myproj/env/lib/python3.6/site-packages/pytest_tldr.py", line 17, in pytest_configure
INTERNALERROR>     reporter = TLDRReporter(config, sys.stdout)
INTERNALERROR>   File "/Users/poswald/Projects/myproj/env/lib/python3.6/site-packages/pytest_tldr.py", line 45, in __init__
INTERNALERROR>     self.xdist = self.config.option.numprocesses is not None
INTERNALERROR> AttributeError: 'Namespace' object has no attribute 'numprocesses'
$ pip freeze |grep pytest

pytest==3.6.1
pytest-runner==2.11.1
pytest-tldr==0.1.1
$ python --version
Python 3.6.5

Installing pytest-xdist fixes it.

raise RuntimeError(f"Failed to collect tests from {entry.path}

Hi, I'm having a bit of trouble using the tool.
When I try to run the pytest_web_ui like so: 'python3 -m pytest_web_ui {path_to_my_project_folder}'
I get an error message: Failed to collect tests from {path_to_my_project_folder}/conftest.py
I can't figure out why it's searching in conftest.py for tests.
The project contains 6 tests in a file named test_program not in a class.
I have no idea why this happens.. Any help will be very much appreciated. Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.