Top "Pytest" questions

Simple powerful no-boilerplate testing with Python.

allure: command not found on linux

I am trying to integrate allure report generation utility with py.test framework. I have installed allure on linux with …

pytest allure
List available tests with py.test

I can't find a way to list the tests which I can call with py.test -k PATTERN How can …

python unit-testing pytest
WARNING: Failed to generate report: No data to report error in python using pytest module

Sample.py code: def sum(num1, num2): return num1 + num2 def sum_only_positive(num1, num2): if num1 > 0 and …

python pytest coverage.py pytest-cov
Making py.test, coverage and tox work together: __init__.py in tests folder?

I'm having a weird problem with tox, py.test, coverage and pytest-cov: when py.test with the --cov option is …

python code-coverage pytest coverage.py tox
What is the difference between unittest, pytest and nose modules?

I'm new in python testing and am having some diffiulties choosing between unittest, pytest and nose nose. I'm bulding a …

python nose pytest python-unittest
PytestUnknownMarkWarning: Unknown pytest.mark.xxx - is this a typo?

I have a file called test.py with the following code: import pytest @pytest.mark.webtest def test_http_request(): …

python-3.x pytest anaconda3 pytest-markers
difference between fixture and yield_fixture in pytest

I am going through pytest fixtures, and the following looks pretty similar, latest works pretty similar. Yes, the readability is …

python python-2.7 pytest fixtures
py.test : Can multiple markers be applied at the test function level?

I have seen from the pytest docs that we can apply multiple markers at once on the Class or module …

python pytest markers
How to I display why some tests where skipped while using py.test?

I am using skipIf() from unittest for skipping tests in certain conditions. @unittest.skipIf(condition), "this is why I skipped …

python unit-testing pytest
pytest fixtures Redefining name from outer scope [pylint]

I'm learning pytest and I lint my code with pylint. But pylint still complaints about: W0621: Redefining name %r from …

python pytest pylint fixture