35 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
48
views
Can your parametrize a fixture from another fixture that generates a list of values?
I have some example pytest code like this, simplified for this question:
# conftest.py
a=[0,1,2,3]
@pytest.fixture(params=a)
def simple_fixture(request):
return request.param
#test_my_script.py
@...
0
votes
0
answers
114
views
"param = glm" gave a singular matrix warning while "param = ref" did not
I'm conducting a multinomial logistic regression model using proc logistic in SAS with around 3.6 million observations, an outcome with 5 levels, and dozens of categorical predictors. I had no issue ...
0
votes
1
answer
94
views
Pytest - parametrizing a test method from a fixture
I have a scenario where there is a fixture (in conftest.py) that reads data from a file and returns a dict. I have to use this dict to parametrize a test method. Can someone help me with this?
The ...
1
vote
1
answer
1k
views
How to use variable in MAUI AndroidManifest.xml file based on configuration
I'd like to use different values for dev,qa,prod environments in .Net MAUI app AndroidManifest.xml file or different version of the file like AndroidManifest.dev.xml, AndroidManifest.release.xml.
I ...
11
votes
2
answers
415
views
Parametrised classes
I have a class as follows:
class Token a where
symbol :: a -> String
I also want all instances of Token to have a function convert which returns a parametrised type. The conversion alone works ...
2
votes
2
answers
71
views
How can I use the transformed data from the fixture for parameterization within the current test?
I have next code for pytest:
import pytest
@pytest.fixture
def my_fixture():
def _method(a_list):
return [num*0.5 for num in a_list]
return _method
# @pytest.mark.parametrize ??
def test_me(...
0
votes
1
answer
181
views
How can I parametrize a function in pytest with a dynamic number of arguments that are based on another fixture?
I'm looking forward to do something similar to the solution described here:
Can I parameterize a pytest fixture with other fixtures?
But in my use case I want to have a dynamic number of tests based ...
0
votes
0
answers
90
views
pytest: parameterize a test via loaded cfg file which has the name of the current test name
I would like to create a test that uses input parameters. The parameters exist in a configuration file (cfg) under my project. It is important to look for a cfg file with the same name as the current ...
2
votes
1
answer
605
views
pytest: combine class level parametrization with class scoped fixtures
I have tests that are identical for various values, so I want to parametrize the test class. Because the code is making network calls, I also want to use class scoped fixtures.
I tried
import pytest
@...
0
votes
1
answer
151
views
How to pass a function name in parametrize in pytest and How can i use that in testcase?
In the below script i would like to parametrize functions call RegisterClientCabinMovementDetection(x) and RegisterClientOccupantInSeatDetection(x) (made bold in script)so on... is there any way to ...
2
votes
1
answer
88
views
How to avoid parametrization of a Pytest class when skipping it?
I have two Pytest classes: one test class is very fast and the other is slower, parametrizing itself with a function call and reusing that resource across multiple tests.
My problem is that, when ...
0
votes
1
answer
2k
views
Using parametrize for multiple arguments in pytest
There is such a function:
def underscore_concat(*args):
return "_".join(filter(None, ([*args]))).upper()
How to correctly pass multiple parameters using pytest.mark.parametrize?
...
1
vote
0
answers
705
views
How to use variable from fixture as a parameter in @pytest.mark.parametrize()?
I hope that there is a simple solution for this, but I was unable to find anything. Basically, i have fixtures.py file where I have created a simple fixture that returns some variable:
import pytest
@...
-1
votes
1
answer
87
views
Parametrize the usage of static variables in an abstract class
I am generating a report for a customer of our company.
I have a abstract class with lots of static final int members:
public abstract class Customer_ItemIDs {
public static final int item_001 = ...
0
votes
0
answers
37
views
Do we need to use parametrization for unit testing if we are 'setting mock objects' to different inputs but not using them in our code?
Here is the unit test I have written:
@pytest.mark.parametrize('mock_finfo, mock_download_result',
[
({'ready': False},
...