Questions tagged [pytest]

Pytest is a framework for writing unit tests for Python code. More information is available at docs.pytest.org.

9 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
2answers
46 views

Is it possible to add specific tests to the collected tests?

I'm using pytest with Appium for mobile testing. I have multiple test cases and scenarios, and all of them must start with the same specific test steps. I don't want to write this steps in all other ...
1
vote
1answer
924 views

Is there a way in PyTest to pass command line arguments to conftest.py directly?

I know that there is a way to pass args in tests itself like it was shown here, but is there a way to pass in conftest.py directly? I want to configure some common stuff for all tests this way.
1
vote
0answers
52 views

Issue with parallel testing in pytest

So I have two test cases in a map. From command prompt I type "pytest -n 2" then hit Enter. Instead of opening two browsers and execute them in parallel, pytest is opening 4 browsers, but only two of ...
0
votes
0answers
33 views

Pytest - print not showing up in junitxml stdout

With pytest file below test_print.py class TestPrint: def test_print(self): print('NOT CAPTURED IN JUNIT') assert False When I run command line: pytest test_print.py --junitxml=...
0
votes
0answers
20 views

How to use setUp in selenium?

I want to use setUp instead of setUpClass in my selenium tests. This code works fine and is able to get the correct host when using setUpClass: @tag('selenium') @override_settings(ALLOWED_HOSTS=['*']) ...
0
votes
0answers
422 views

pytest one time teardown after all tests in all modules have run

I have a directory with a bunch of modules. Each module has a bunch of specific tests. I know how to teardown after methods, classes and modules. What am trying to do is teardown after all the tests ...
0
votes
0answers
73 views

Using live_server fixture in pytest: Site cannot be reached

I am trying to run selenium tests with pytest-django for my django app. Pytest-django provides a fixture called live_server. I am supposed to get the URL with live_server.url. Now when I try to visit ...
0
votes
0answers
131 views

Problem with parallel testing (POM, python, selenium, pytest)

I have a dir named PageObjects, there is a file Login.py. It stocks all the locators of elements plus functions that I call in test cases. It looks like this: class Login: # Locators of all ...
-1
votes
1answer
23 views

How to do ETL Automation Testing using C# or Python

In my present project I m testing on reports which needs to be checked everyday manually by executing SQL queries for all columns from source tables, Dims and Facts tables and destination tables. Is ...