Skip to content

Conversation

@sloboegen
Copy link
Contributor

@sloboegen sloboegen commented Jul 22, 2024

Relates #5966.

Below is the info what happened with the concrete test from cmdline.test:

  1. testErrorContextConfig => check-flags.test (testShowErrorContextFunction) [duplicate]
  2. testNoConfigFile => check-flags.test (testNoConfigFile) [move]
  3. testPerFileConfigSection => check-flags.test (testPerFileUntypedDefs) [move]
  4. testIgnoreErrorsConfig => check-flags.test (testPerFileIgnoreErrors) [move]
  5. testConfigFollowImportsNormal => check-flags.test (testFollowImportsNormal) [move + modified]
  6. testConfigFollowImportsSilent => check-flags (testFollowImportsSilent) [move + modified]
  7. testConfigFollowImportsSkip => check-flags (testFollowImportsSkip) [move + modified]
  8. testConfigFollowImportsError => check-flags.test (testFollowImportsError) [move + modified]
  9. testConfigFollowImportsSelective => check-flags.test (testFollowImportsSelective) [move]
  10. testConfigSilentMissingImportsOff => check-flags.test (testSilentMissingImportsOff) [move]
  11. testConfigSilentMissingImportsOn => check-flags.test (testSilentMissingImportsOn) [move]
  12. testDisallowAnyGenericsBuiltinCollectionsPre39 => check-flags.test (testDisallowAnyGenericsBuiltinTuplePre39, testDisallowAnyGenericsBuiltinListPre39, testDisallowAnyGenericsBuiltinSetPre39, testDisallowAnyGenericsBuiltinDictPre39) [split]
  13. testDisallowAnyGenericsTypingCollections => check-flags.test (testDisallowAnyGenericsTupleWithNoTypeParamsGeneric, testDisallowAnyGenericsPlainList, testDisallowAnyGenericsPlainDict, testDisallowAnyGenericsPlainSet) [split]
  14. testDisallowUntypedDefsAndGeneric => check-flags.test (testDisallowUntypedDefsAndGeneric) [move]
  15. testParseError => parse-errors.test (testMissingBracket) [move]
  16. testParseErrorAnnots => check-fastparse.test (testFasterParseTooManyArgumentsAnnotation) [duplicate]
  17. testNotesOnlyResultInExitSuccess => check-flags.test (testNotesOnlyResultInExitSuccess) [move]

Let's compare test execution time. I've run pytest -n 4 mypy/test/testcmdline.py 3 times on my machine and calculated the average time.

  • Before: 130 tests, 1m 02s
  • After: 115 tests, 0m 55s

Also, if it's possible to use fixture FrozenSet in check-flags.test, we'd be able to totally split items 12 and 13 from the above list.

And testMissingBracket is skipped by pytest in the parse-errors.test-file, but, probably, this file is the best variant for it (not sure about it).

@sloboegen sloboegen marked this pull request as ready for review July 23, 2024 06:35
@sloboegen sloboegen changed the title Move some tests from cmdline.py (#5966 ) Move some tests from cmdline.test (#5966 ) Jul 23, 2024
Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Wow, this is great! Thank you for doing this, and thanks for your notes that made reviewing this PR much easier

@hauntsaninja hauntsaninja merged commit d1a7d09 into python:master Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants