Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8989477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:16:09+00:00 2026-06-15T22:16:09+00:00

I try to collect my tests with py.test but it doesn’t do so. Do

  • 0

I try to collect my tests with py.test but it doesn’t do so.

  • Do I have to provide additional options at the command line?

  • Py.test was executed in the directory of my .py-file. Are there any other requirements?

  • Are my tests named correctly? In my code I used ‘Test-‘ for classes and ‘test_’ for methods.

The results from the terminal:

> py.test

===============================  in 0.00 seconds ============================
user@host:~/workspace/my_project/src/html_extractor$ py.test

============================= test session starts ===========================
platform linux2 -- Python 2.7.3 -- pytest-2.3.4
plugins: xdist
collected 0 items 

My code under test:

class Factories(object):
    TEST_LINKS = ['http://www.burgtheater.at',
                  'http://www.musikverein.at/']

    def links(self):
        for link in self.TEST_LINKS:
            yield link


class TestHTMLExtractor(unittest.TestCase):

    def setUp(self):
        self.factory = Factories()
        self.extractor = HTMLExtractor()


    def test_extract_site_return(self):
        for link in self.factory.links():
             raw_html_page = self.extractor.run(link)

def test_whatever():
    pass

if __name__ == '__main__':
    unittest.main()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:16:10+00:00Added an answer on June 15, 2026 at 10:16 pm

    In the default configuration, the test file should be named test_<something>.py. See Changing standard (Python) test discovery.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to start thinking sphinx on my server but it doesn't want to
I try to collect some information about the current state of the CWInterface(connected bssid,
I'm try to collect some information from the job tracker. For starters I'd like
When I try to build some application with linking boost's library libboost_serialization.so, I have
When I try to compile this file by issuing the command, g++ qr.cpp -o
I met very strange problem. I have Timetable model and try to write my
I have written a script that is to collect hardware and software information from
Suppose I have test.sh as below. The intent is to run some background task(s)
Let's say i have the following string: a test-eh'l I want to capitalize the
Try this code - import java.io.StringReader; public class StringReaderTest { public static void main(String[]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.