Skip to main content

All Questions

Tagged with
1 vote
1 answer
84 views

Pytest monkeypatch a multiprocess function for testing

Pytest monkeypatching a function that uses multiprocess (via concurrent.futures.ProcessPoolExecutor) does not work as expected. If the same function is written with a single process or multithread (...
Kacper's user avatar
  • 23
0 votes
2 answers
59 views

Multiple if-raise statement

I wrote a python code with the following format: if a1 in list1: if b1 == 1 and c1>1: raise Exception ('invalid c1 for b1') elif b1 == 2 and c1>2: raise Exception ('...
Rex's user avatar
  • 23
0 votes
1 answer
49 views

VS code python error can't find imported file

So I am using python and I have the following schema of files: - 10.Testing (parent folder) -- files (folder) |__ __init__.py (empty file) |__simple_functions.py -- tests (folder) |__ ...
FNG_mw2's user avatar
-1 votes
3 answers
338 views

test chrome issue within chromedriver [duplicate]

from selenium import webdriver from selenium.webdriver.chrome.service import Service driver_path = r"C:\Users\hp\Desktop\Udemy\chromedriver.exe" # Replace with your correct path # Create a ...
AFREEN POLY's user avatar
0 votes
1 answer
59 views

pytest fixtures in nested Classes

I have written the following testcase using pytest. import pytest data_arg = ["arg1", "arg2"] class TestParentClass1: @pytest.fixture(scope="class", params=data_arg,...
Shreyansh Jain's user avatar
0 votes
1 answer
21 views

Can I get access to a pytest hook to inject my logic AFTER the junit XML results file has been created?

From reading the docs I see that the latest hook after a test class has completed is pytest_runtest_logfinish. However, when I implement that hook and use the debugger, I see that the XML file (...
Leggy's user avatar
  • 155
0 votes
0 answers
23 views

Mock or stub a QEvent?

Is there a way to mock a QEvent and pass it as a parameter? I have a test like this which I want to include: def test_table_resize_event_sets_column_widths(): table = results_table_classes....
mike rodent's user avatar
  • 15.1k
1 vote
1 answer
49 views

Increasing test coverage for files I didn't write

I have written a python program that calculates various statistical values of a given list of integers and the range of values. Now, I am trying to write a test file for the program that can achieve &...
Austin's user avatar
  • 51
0 votes
0 answers
144 views

'dict object' has no attribute 'test_name'. This can happen when calling a macro that does not exist. Check for typos and install package dependencies

I'm calling a test within a model column in my schema.yml file, however, when running a "dbt compile" it says it doesn't find the test in the macros folder, and I configured that the tests ...
Arthur Gabriel Camacho Marques's user avatar
1 vote
0 answers
30 views

How to use multiple API modules in a single testing file?

Disclaimer: first Stack Overflow post, and very new to pytest. I'm a part of a very new QA team in the company. Right now we are focusing on creating initial tests for various Sync APIs (most of them ...
Ariel Agranovich's user avatar
0 votes
1 answer
26 views

firestore how to get list of orphaned documents

I am developing a firestore CLI tool called firebatch I read that to properly delete a collection and to avoid orphaned documents, you have to traverse all subcollections and delete them first. I have ...
user2505961's user avatar
0 votes
0 answers
131 views

Python tests failing due to testcontainers-postgres connection refused

I am trying to run integration tests by using PostgresContainer from the testcontainers module in Python. These tests are part of the CI workflow on Github Actions but they are failing due to the ...
Asad Amir Khwaja's user avatar
0 votes
0 answers
88 views

load testing for burst requests using locust

I am trying to simulate a burst request in locust of 1200 with request rate of 600 per second @task def send_burst_request(self): def send_request(): self.client.get( ...
Tanu's user avatar
  • 1,462
0 votes
3 answers
55 views

Pytest: When writing many assert statements in the same test function, some of it fails, but how to know which assert statement/s is causing failure?

Test file : from RansomNote import Solution def test_canConstruct(): sol = Solution() assert sol.canConstruct('aa', 'aab') == True assert sol.canConstruct('xx','aaabc') == True assert ...
PG23's user avatar
  • 1
0 votes
0 answers
41 views

webdriver error while working with selenium with python

I am getting this error C:\Users\Admin\PycharmProjects\Testing\.venv\Scripts\python.exe C:\Users\Admin\PycharmProjects\Testing\firsttest.py Traceback (most recent call last): File "C:\Users\...
pooja's user avatar
  • 1

15 30 50 per page