Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Drop unused unittest components from test helpers and replace tests with pytest-based ones #67
@@ Coverage Diff @@ ## master #67 +/- ## ========================================= - Coverage 62.33% 18.34% -44% ========================================= Files 15 15 Lines 2963 2748 -215 ========================================= - Hits 1847 504 -1343 - Misses 1116 2244 +1128
Dec 14, 2017
Although it's found in the 'tests' package, the webtest module in particular is part of the public interface of cheroot and cherrypy.
I did a quick search for ReloadingTestLoader, which turns up quite a few results. If there are users relying on this functionality, this change will need to describe what the recommendation is for those users. Maybe the recommendation is they adapt their tests to a new model--a fairly harsh ask. Or maybe we release this functionality in a separate package. I can't decide whether it's worth an intermediate release deprecating this functionality first.
In any case, I'm largely in favor of this change as long as we can make it without causing undue disruption.
I don't know about _handlewebError, but I would recommend that in a pytest scenario, one shouldn't use _handlewebError, and the tests should just make assertions and let the test runner handle interactivity (such as through --pdb). Given that it's got the underscore prefix, I'd say it's sane to deprecate/remove it.
@jaraco well, it's kinda public, because depending on the environment variable (which I would consider to be a public interface) it intercepts assertion failures and provides an interactive interface for accessing/printing HTTP request/response values and suppressing/raising a real failures during test runs.
On the other hand I don't really see any need for this interface.
Also, I'd like to provide some new public pytest-oriented fixtures/helpers in
I agree, creating an officially-supported
Overall, this is great. I see lots to love in this change. I could have added a few nitpicks, but I decided to refrain so we can get this out and iterate on it. I did add a couple of comments I think are worthy of addressing in this PR, but nothing glaring. And tests work for me.
I haven't tested it against CherryPy. If you can confirm CherryPy tests pass with these changes, I'm prepared to rubberstamp!