Closed mitya57 closed 8 years ago
Thank you. I appreciate you taking the time to put something together, but isn't this just covering up the problem? ISTM the larger issue would be that class names are not being preserved. :-(
@jszakmeister According to http://bugs.python.org/issue22032#msg251500, "tests should not rely on the exact representation". So this is what I did.
Okay, but the difference in output is striking (from #928):
- test (package2c.test_module.TestCase) ... ok
? ^^ ^ ^
+ test (package2c.test_module.transplant_class.<locals>.C) ... ok
? ^^^^ ++++ ^^^ ^^^^^^^^^^^^
Who is going to know what package2c.test_module.transplant_class.<locals>.C
refers to? That's the root problem to me. Making the tests pass seems like papering over the real problem.
@jszakmeister Okay, here comes something much cleaner.
Much better! Thank you!
Use
startswith
/endswith
instead of strict matching on class names.Also, in unit_tests/test_xunit.py, drop support for Python ≤ 2.4 which did not have ElementTree.
This fixes #928.