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

0 votes
Apr 28 in Python by anonymous
• 120 points
69 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 by Gitika
• 51,280 points

Related Questions In Python

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,030 points
225 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
325 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
147 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
65 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
410 views
0 votes
2 answers
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
3,650 views
0 votes
1 answer
0 votes
1 answer

How to generate a string token using four of this items random?

One approach just generates random integers up ...READ MORE

answered Nov 15 in Python by Gitika
• 51,280 points
44 views