Skip to content

Conversation

@sobolevn
Copy link
Member

@sobolevnsobolevn commented Nov 3, 2023

Now this file will always be executed on test_difflib, which will protect us from future problems.

It passes in both test-running styles:

» ./python.exe -m test test_difflib Using random seed: 693048103 0:00:00 load avg: 1.81 Run 1 test sequentially 0:00:00 load avg: 1.81 [1/1] test_difflib == Tests result: SUCCESS == 1 test OK. Total duration: 584 ms Total tests: run=52 Total test files: run=1/1 Result: SUCCESS 
» ./python.exe Lib/test/test_difflib.py .................................................... ---------------------------------------------------------------------- Ran 52 tests in 0.569s OK 

@terryjreedy
Copy link
Member

Re-running unrelated failures.

Copy link
Member

@terryjreedyterryjreedy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When fixing difflib.rst doctests, I used doctest.testfile, which a) runs the tests without any extra sphinx directive and b) reported that there were 47 tests. (I am not sure if that counts 'statements' or 'contiguous statement blocks, but this does not matter here.) DocTestSuite appears to count each docstring as one test. Running with -v:

... # Normal unittests Differ (difflib) Doctest: difflib.Differ ... ok _fancy_replace (difflib.Differ) Doctest: difflib.Differ._fancy_replace ... ok ... # Other docstring tests unified_diff (difflib) Doctest: difflib.unified_diff ... ok 

DocFileSuite sees the entire file essentially 1 docstring (sort of sensible) and therefore as 1 test (instead of the 47 reported by testfile. At the end of -v output:

f:\dev\3x\Doc/library/difflib.rst Doctest: difflib.rst ... ok 

However, this is enough, I believe, to show that the added tests were run.
Getting 51 instead of 52 tests run on main (without -v) says the same.

I suspect that many of the tests are more or less the same in docstring and doc, but supposedly duplicate copies both need testing.

@terryjreedy
Copy link
Member

Unreleated test.test_asyncio.test_streams again 'altered the execution environment (env changed):'.

@sobolevn
Copy link
MemberAuthor

@terryjreedy oh, I am sorry, there's a bigger thing! Please, take a look at #111704

We have a wider problem: many doctests are not executed and have problems.
So, I think we should ignore this PR for now.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sobolevn@terryjreedy@AlexWaygood@hugovk