Skip to content Skip to sidebar Skip to footer
Showing posts with the label Pytest

How To Clear Captured Stdout/stderr In Between Of Multiple Assert Statements

I have some tests with assertions in loop, each assertion is kinda like separate test and I don… Read more How To Clear Captured Stdout/stderr In Between Of Multiple Assert Statements

Define A Pytest Fixture Providing Multiple Arguments To Test Function

With pytest, I can define a fixture like so: @pytest.fixture def foo(): return 'blah' … Read more Define A Pytest Fixture Providing Multiple Arguments To Test Function

How To Use Logging, Pytest Fixture And Capsys?

I am trying to unit-test some algorithm that uses logging library. I have a fixture that creates a … Read more How To Use Logging, Pytest Fixture And Capsys?

Double Parameterization

So I have a set of tests where I'd like to test multiple versions of a solution. Currently I ha… Read more Double Parameterization

Py.test Passing Results Of One Test To Another

Currently I have test looking like this: @pytest.mark.parametrize('param', [1,2,3]) def tes… Read more Py.test Passing Results Of One Test To Another

How To Test A Django Model With Pytest?

I am getting started with pytest. I have configured pytest, anyway I couldn't found a resource … Read more How To Test A Django Model With Pytest?

Parametrizing Test With Multiple Fixtures That Accept Arguments

I am trying to test a math function that I wrote. I would like to supply data to it from a number o… Read more Parametrizing Test With Multiple Fixtures That Accept Arguments

Change Pytest Working Directory To Test Case Directory

I have the following pytest directory structure: system_tests/ ├── conftest ├── pytest.ini │ … Read more Change Pytest Working Directory To Test Case Directory