-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Plans for mypy.myunit
#908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sweet, just realized that |
Most things look reasonable (though I didn't quite understand how the fixtures would work) but some of these probably aren't the highest-impact things we could be working on and probably not worth the extra complexity, such as the different test failure modes. Having just PASS, FAIL (maybe XFAIL) and SKIP would be enough, and the rest would be of marginal utility. I've worked with much larger test suites that did just well with only a few test modes. My recommendation is to create individual issues for the ones you think are the most useful (you can leave this open as an umbrella task), and with a little more detail on each issue. It's better to discuss specifics outside this umbrella issue. Please send separate pull requests for each of the issues, prefarably not stacked on top of each other. That way you'll get the fastest review turnaround times (unless I'm traveling or something and can't get this done -- I'll try to post an update to your open PRs if that happens so that at least you know what's going on). My personal favorite thing to fix related to running tests would be #910. |
I believe this can be closed as it is out of date and we are moving away from myunit (see #1673) |
Since
driver
is now merged,mypy.myunit
is a package instead of a module; however all the logic is still in__init__.py
and has irritating limitations.Note that in these plans I am not yet making myunit and the driver aware of each other, just laying out a framework.
myunit
are actually used from elsewhere.Any
.-l
to only collect and print.fnmatch
instead of hand-written glob functions (likely via regex conversion, so we can add a command-line option to take a regex directly).myunit
itself.from mypy.myunit.assertions import *
mypy.myunit.annotations
, see https://gist.github.com/o11c/ef8f0886d5967dfebc3dassert_foo
function" to replace the current traceback-cleaning logic, which is wrong if something goes wrong in the assert function itself.assert_foo
function is actually run for every testcase.mypy.myunit.ick
mypy.myunit.main
(name.strip('_'), annotated_type)
in current module and inmypy.myunit.fixtures
(use this for tempdir maybe?)cases
to overridinginit
, likely in a base class that takes care of callingparse_tests
.Anyway, the big change is global test naming.
New test names have more dots, and will look like
mypy.test.testlex.LexerSuite.test_empty
. It is not always as simple asgetattr
- modules need to be imported, classes need to be instantiated, data-driven cases need to be parsed, etc.The first component name will always be a module, and most likely always be just
'mypy'
depending on what is done about #724I introduce two new classes,
TestFactory
andTest
, to avoid refactoring the responsibilities ofSuite
andTestCase
. There will be a bridge of course, or maybe the old classes will just be subclasses of the new ones. Possibly the old classes will go away entirely.API will look something like:
Bikeshed: what do we call the module in which
Suite
,TestCase
,TestFactory
, andTest
reside? Same module or separate ones?The text was updated successfully, but these errors were encountered: