how to run test cases of different modules with same marker at a time using pytest

0 votes
Apr 28, 2020 in Python by anonymous
• 120 points
88 views

1 answer to this question.

0 votes

Hey,@Nikitha,

Suppose you have multiple files say test_sample1.py, test_sample2.py. To run all the tests from all the files in the folder and subfolders we need to just run the pytest command.

py.test

This will run all the filenames starting with test_ and the filenames ending with _test in that folder and subfolders under that folder. To run tests only from a specific file, we can use py.test <filename>

py.test test_sample3.py

I hope this will help you.

answered Apr 28, 2020 by Gitika
• 65,870 points

Related Questions In Python

0 votes
1 answer
0 votes
1 answer

How to check latest change time of each file using glob in python?

You can get the changing time from ...READ MORE

answered Jan 2, 2019 in Python by Omkar
• 69,090 points
290 views
0 votes
1 answer

How to zip with a list output in Python instead of a tuple output?

Good question - Considering that you are ...READ MORE

answered Feb 7, 2019 in Python by Nymeria
• 3,520 points
427 views
0 votes
2 answers

How to add a certain time delay to the code using Python?

You can use time.sleep(duration in second) READ MORE

answered Feb 14, 2019 in Python by Shashank
• 1,370 points
205 views
0 votes
1 answer

How to access each pandas row at a time?

The code you are using will iterator ...READ MORE

answered Mar 28, 2019 in Python by Karan
77 views
0 votes
1 answer

How to print rows at different locations of pandas dataframe?

Like you are using row slicing, you ...READ MORE

answered May 12, 2019 in Python by Gani
533 views
0 votes
1 answer

How to create a train and test sample from one dataframe using pandas?

Hi, The below written code can help you ...READ MORE

answered Jul 3, 2019 in Python by Taj
• 1,080 points
4,182 views
0 votes
1 answer

How to access the elements of a dictionary using index ?

Suppose you have a dictionary num = ...READ MORE

answered Jul 4, 2019 in Python by Arvind
• 2,980 points
85 views
0 votes
1 answer
0 votes
4 answers

how to sort a list of numbers without using built-in functions like min, max or any other function?

I guess you are trying to do ...READ MORE

answered Dec 11, 2020 in Python by Rajiv
• 8,880 points
30,947 views