1,752 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-2
votes
1
answer
69
views
Selenium use database for Chrome but not for Firefox
I have an app for listing my books.
I want to test my code in chrome and firefox both, using the fixture in my database but without touching the real database. In the database I have some data for the ...
Best practices
1
vote
0
replies
45
views
Conditionally select fixture in pytest
I have an ETL build with sqlalchemy. To test it, we are using postgres in a docker container through pytest-docker.
But because on some computer, spinning docker container takes some time, we also ...
0
votes
1
answer
142
views
Headless Google Chrome in Pycharm doesnt work at the background using Pytest fixture
I'm learning auto tests in python, and in one video a guy using Mozilla for tests and he uses the following code block:
import pytest
from selenium import webdriver
from selenium.webdriver.chrome....
0
votes
2
answers
116
views
How to extend fixture from the base class?
I'm trying to extend a fixture: that means not only overriding, but partially reusing the old one. For example, in the code below the fixture Test.values uses the fixture values and concatenates lists ...
0
votes
1
answer
66
views
How do I parameterize a list of URL's for Selenium tests using PyTest?
I would like to automate disabling subscriptions for 100 stores on a website. I have clicked this together once in Firefox and now I need help on how to have Selenium loop through the steps while ...
1
vote
3
answers
253
views
Playwright Re-Runs beforeAll and Reseeds Data When a Test Block Fails
We use a feature‐testing approach, where each Playwright test file covers an entire feature from start to finish. In these files, I generate random data (e.g., school name, leader email) at the module ...
1
vote
0
answers
78
views
How to make Spark global for unit testing in via pytest (and fixture)?
I have Databricks asset bundles and writing unit tests for functions in notebooks using pytest. I create spark session via pytest.fixture, my problem is the scope of Spark.
@pytest.fixture(scope="...
1
vote
1
answer
116
views
How to find all references of a pytest fixture in vscode?
I'm refactoring a suite of tests and pytest fixtures, and need to locate all usages of a fixture within the test suite.
The 'Find all references' function of VSCode is what I'd normally use when ...
1
vote
2
answers
146
views
Pytest fixture is changing the instance returned by another fixture
I'm very baffled and a little concerned to discover the following behaviour where I have two tests and two fixtures.
import pytest
@pytest.fixture
def new_object():
return list()
@pytest.fixture
...
0
votes
0
answers
29
views
Can Pytest dynamically trigger other files and share objects?
I've been bashing my head into this wall for a while. I'm testing a bunch of hardware and each piece of hardware has child objects that I also have written tests for. So my issue is that I have a lot ...
0
votes
1
answer
47
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
@...
2
votes
1
answer
117
views
Incongruence between rails guide and test error message
The following unit test, purposely blank
class CustomMailerTest < ActionMailer::TestCase
test "message_email" do
end
end
where the class CustomMailer defines a message_email method.
...
0
votes
0
answers
54
views
Removing all the Mock JSON fixtures to convert it into methods for the similar use
In my project, we have 1000+ fixtures (mock JSON) files. I am required to find a way to remove all these JSON files, and use .mock() methods instead. Here is an example:
struct Person {
var name: ...
2
votes
1
answer
105
views
Caching of parameterized, nested fixtures in pytest
I am trying to understand how and when return values from pytest fixtures are cached. In my understanding, the goal of fixtures (in particular session-scoped fixtures) is that they are called only ...
0
votes
0
answers
44
views
Python mocking, why doesn't mocker need to get initialized. How to inject fixture into unit test
I am writing an unit test where I need to mock api behavior, there are two parts of question. Right now I am using fixture which works fine but I don't really understand the mock works here, I don't ...