Top "Pytest" questions

Simple powerful no-boilerplate testing with Python.

PATH issue with pytest 'ImportError: No module named YadaYadaYada'

I used easy_install to install pytest on a mac and started writing tests for a project with a file …

python unit-testing pytest
How to properly assert that an exception gets raised in pytest?

Code: # coding=utf-8 import pytest def whatever(): return 9/0 def test_whatever(): try: whatever() except ZeroDivisionError as exc: pytest.fail(exc, …

python unit-testing testing pytest
How can I see normal print output created during pytest run?

Sometimes I want to just insert some print statements in my code, and see what gets printed out when I …

python logging output pytest
How to print to console in pytest?

I'm trying to use TDD (test-driven development) with pytest. pytest will not print to the console when I use print. …

python unit-testing python-2.7 pytest
Is there a way to specify which pytest tests to run from a file?

Is there a way to select pytest tests to run from a file? For example, a file foo.txt containing …

python pytest
How do I correctly setup and teardown for my pytest class with tests?

I am using selenium for end to end testing and I can't get how to use setup_class and teardown_…

python class object pytest
pytest cannot import module while python can

I am working on a package in Python. I use virtualenv. I set the path to the root of the …

python import pytest
How do I configure PyCharm to run py.test tests?

I want to start writing unit tests for my Python code, and the py.test framework sounds like a better …

python pycharm pytest
Pass a parameter to a fixture function

I am using py.test to test some DLL code wrapped in a python class MyTester. For validating purpose I …

python fixtures pytest
unittest Vs pytest

In unittest, I can setUp variables in a class and then the methods of this class can chose whichever variable …

python pytest unit-testing