• 
      

    Fix no-ops with the @online_only unit test decorator.

    Review Request #14940 — Created March 18, 2026 and updated

    Information

    Review Board
    release-7.1.x

    Reviewers

    In 2021, the @online_only decorator was rewritten to use
    @simple_decorator, but the result was a function that performed no-ops
    when online. Instead of calling the test function with the provided
    arguments, it just returned the first argument as-is (which was the
    self argument to the unit test class). This got ignored, resulting in
    nothing happening when the test was run.

    This did unveil that one test (Mercurial's HTTPS tests) were no longer
    passing. This was due to the repository having bot protection deployed,
    which meant we were getting HTTP 200 results that weren't actually the
    file contents. We've switched to Mozilla's HG server for our test, which
    currently has no bot protection.

    Unit tests pass.

    Summary ID
    Fix no-ops with the @online_only unit test decorator.
    In 2021, the `@online_only` decorator was rewritten to use `@simple_decorator`, but the result was a function that performed no-ops when online. Instead of calling the test function with the provided arguments, it just returned the first argument as-is (which was the `self` argument to the unit test class). This got ignored, resulting in nothing happening when the test was run. This did unveil that one test (Mercurial's HTTPS tests) were no longer passing. This was due to the repository having bot protection deployed, which meant we were getting HTTP 200 results that weren't actually the file contents. We've switched to Mozilla's HG server for our test, which currently has no bot protection.
    54a4efab49603787b2a46fabd42bb07bf5dfb35f
    Description From Last Updated

    It seems like this should just be return test_func

    daviddavid
    Checks run (2 succeeded)
    flake8 passed.
    JSHint passed.
    david
    1. 
        
    2. reviewboard/testing/__init__.py (Diff revision 1)
       
       
      Show all issues

      It seems like this should just be return test_func

    3.