Skip to content

Every request object is equal #3116

Closed
@frmdstryr

Description

It seems the == operator evals to True for every request object.

from aiohttp.test_utils import make_mocked_request

def test_path_equals():
    req = make_mocked_request('GET', '/a/')
    req2 = make_mocked_request('GET', '/b/')
    assert req.path != req2.path
    assert req != req2

def test_method_equals():
    req = make_mocked_request('GET', '/a/')
    req2 = make_mocked_request('POST', '/a/')
    assert req.method != req2.method
    assert req != req2
    
def test_equals():
    req = make_mocked_request('GET', '/this/isnot/evenclose')
    req2 = make_mocked_request('OPTIONS', '/search?query=what')
    assert req.path != req2.path
    assert req.method != req2.method
    assert req != req2

Is this intentional?

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions