In my pytest suite, I run plenty of iOS UI tests. Which comes with plenty of frustrating issues. Im experimenting with the use of a hook based retry logic. Essentially, I have a pytest_runtest_call hook, where I collect the output of a test via a yield, and do extra processing with that data. Based on the failed output of the
Tag: testing
Parametrizing fixtures and functions without combinations
Here’s the thing: I have an Array2D class that receives parameters ‘shape’ and ‘val’. The constructor is as follows: I would like to perform tests on this class. To do this I have declared a variable ARRAY_CONFIG, which lists parameters for different two-dimensional arrays. Here is an example: I have also defined other lists that store the expected values for
How to scroll down in side menu
I am new to selenium python, how to scroll down to the bottom of the filter in swiggy. When I tried the background page is getting scroll instead of filter. enter image description here Answer First you have to be sure to target the correct element, in this case the side menu, then with javascript you can edit its scroll
django pytest how to test a view with argument(id)
i have a question regarding using pytest. These are my very 1st tests. I have 2 views which i want to test (simplest possible way). Views: Here are my tests: Urls: 1st test (menu view) is working properly 2nd test (cuisine details view) shows error I know i should probably put somethere ID argument but tried few options and havent
Trying to run a test to see how many children it takes to have one of each sex but the array is not working properly?
I am running some code for a class and I have no clue what to do, I submitted the assignment but it’s not helpful if I don’t know what to do in the end. Here is the code that I am running to try and track these tests. The idea is to see how many children it takes before you
Parametrized RuleBasedStateMachine
After watching https://www.youtube.com/watch?v=zi0rHwfiX1Q I tried to port the example from C (implementation) and Erlang (testing) to Python and Hypothesis. Given this implementation (the rem function emulates %’s C behavior): and this test code The actual question is how to use Hypothesis to also parametrize over QueueMachine.cap instead of setting it manually in the test class. Answer You can set self.queue
Issues setting up python testing in VSCODE using pytest
I am trying to use the testing extension in VSCode with the Python extension. I am using pytest as my testing library. My folder structure looks like this: In the test_main.py file I am trying to import the package code, in order to test it: From the command line, in the root directory, PACKAGENAME, I can use the command python
How to mock subsequent function calls in python?
I’m new to testing and testing in python. I have a python class that looks like this : File name : my_hive.py I want to mock these functions : pyhive.hive.connect, pyhive.Connection.cursor(used by my class as hive.connect(hive_ip).cursor()) and pyhive.Cursor.execute (used by my class as self.cursor.execute(command) in execute method). I’m able to mock function call hive.connect and also I have been able
How can I pass in url arguments to an APIRequestFactory put request?
I have been trying for hours but cannot figure out how to pass a url argument through an APIRequestFactory put request. I have tried it through Postman when running my server and the url variable is passed just fine, but when I run it in my tests it stops working. What I mean is that when I send a Postman
Python add pytest –black to test suite
I use pytest for testing my Python project. What I want to do is to add to my test suite a function to check whether my code is formatted in “Black” or not. When I press the command “pytest –black” my whole project is tested as I want to. How can I add this function in my tests suite and