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
26 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
• 29,690 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,060 points
145 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,540 points
124 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
73 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
43 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
107 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,060 points
2,053 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
36 views
0 votes
1 answer
+1 vote
1 answer

Want to know how to write paragraph on image using pillow python?

Hi, @Shantanu, You can make use of the ...READ MORE

answered Apr 14 in Python by Gitika
• 29,690 points
86 views