Unable to debug in pycharm with pytest

For my situation, I found what the problem is: If there is –cov in pytest.ini, then breakpoints in pycharm won’t work, after deleting all –cov in pytest.ini, the breakpoints in pycharm can work. Reason: “The coverage module and pycharm’s debugger use the same tracing api (sys.settrace) – they don’t work together. ” — https://github.com/pytest-dev/pytest-cov/issues/131 References: … Read more

pytest fixtures Redefining name from outer scope [pylint]

The pytest docs for @pytest.fixture say this: If a fixture is used in the same module in which it is defined, the function name of the fixture will be shadowed by the function arg that requests the fixture; one way to resolve this is to name the decorated function fixture_<fixturename> and then use @pytest.fixture(name=”<fixturename>”). So … Read more

Test case execution order in pytest

In general you can configure the behavior of basically any part of pytest using its well-specified hooks. In your case, you want the “pytest_collection_modifyitems” hook, which lets you re-order collected tests in place. That said, it does seem like ordering your tests should be easier — this is Python after all! So I wrote a … Read more

nose vs pytest – what are the (subjective) differences that should make me pick either? [closed]

I used to use Nose because it was the default with Pylons. I didn’t like it at all. It had configuration tendrils in multiple places, virtually everything seemed to be done with an underdocumented plugin which made it all even more indirect and confusing, and because it did unittest tests by default, it regularly broke … Read more

py.test skips test class if constructor is defined

The documentation for py.test says that py.test implements the following standard test discovery: collection starts from the initial command line arguments which may be directories, filenames or test ids. recurse into directories, unless they match norecursedirs test_*.py or *_test.py files, imported by their package name. Test prefixed test classes (without an __init__ method) [<– notice … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)