-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
In unit tests, Application comparisons can report false positive #1866
Labels
Comments
You've raised an interesting problem.
I'm inclining to option 2 (all potentially broken tests should be fixed as well). |
5 tasks
For the record (and as far as my opinion matters), I would agree with option 2. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Comparison between Application is performed at the MutableMapping level. MutableMapping says that, like dict objects, if all keys and matching values are the same 2 instances, then they are equals. This means that
web.Application() == web.Application()
will return True.See:
I think those few unit tests are assuming a different behaviour:
A change has been submitted for
test_subapp_middlewares
in #1854 to fix that. While the solution may or may not be accepted as is, all tests should be fixed.Also, maybe an additional
test_application_equal
should be implemented, to be ensure expected behavior. Unlessweb.Application.__eq__
special method gets implemented to change current behaviour, it should look like something like that:The text was updated successfully, but these errors were encountered: