This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author stijnvandrongelen
Recipients stijnvandrongelen
Date 2021-01-12.10:39:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1610447982.97.0.137318779169.issue42906@roundup.psfhosted.org>
In-reply-to
Content
I have two files, named time.py and time_.py, with the same contents:

    def foo():
        """Returns 1.

        >>> foo()
        1
        """
        return 1

When I run

    python3 -m doctest -v time_.py

I see the expected behaviour:

    Trying:
        foo()
    Expecting:
        1
    ok
    1 items had no tests:
        time_
    1 items passed all tests:
       1 tests in time_.foo
    1 tests in 2 items.
    1 passed and 0 failed.
    Test passed.

However, when I run

    python3 -m doctest -v time_.py

it seems like doctest is testing the standard library 'time' module, while I expected it to have similar output as seen above:

        30 items had no tests:
        time
        time.asctime
      (... skipped 24 lines for the bug report ...)
        time.time_ns
        time.tzset
    0 tests in 30 items.
    0 passed and 0 failed.
    Test passed.

The same happens when I provide a path with slashes in it.
History
Date User Action Args
2021-01-12 10:39:43stijnvandrongelensetrecipients: + stijnvandrongelen
2021-01-12 10:39:42stijnvandrongelensetmessageid: <1610447982.97.0.137318779169.issue42906@roundup.psfhosted.org>
2021-01-12 10:39:42stijnvandrongelenlinkissue42906 messages
2021-01-12 10:39:42stijnvandrongelencreate