From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 194401F9FD for ; Tue, 16 Feb 2021 12:19:50 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 7CA16120ADA; Tue, 16 Feb 2021 21:18:54 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 4A038120AD9 for ; Tue, 16 Feb 2021 21:18:53 +0900 (JST) Received: by filterdrecv-p3mdw1-canary-784d987bff-nlwn6 with SMTP id filterdrecv-p3mdw1-canary-784d987bff-nlwn6-19-602BB85C-20 2021-02-16 12:19:40.279537078 +0000 UTC m=+567298.258290153 Received: from herokuapp.com (unknown) by ismtpd0035p1iad2.sendgrid.net (SG) with ESMTP id 4VtwoK0kTbedTzmPGPo2aQ for ; Tue, 16 Feb 2021 12:19:40.226 +0000 (UTC) Date: Tue, 16 Feb 2021 12:19:40 +0000 (UTC) From: eregontp@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 78463 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Misc X-Redmine-Issue-Id: 17591 X-Redmine-Issue-Author: Eregon X-Redmine-Sender: Eregon X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?KippOI8ZHtTweq7XfQzW93937kJ4QNWwSBuHnaMEcr0CC4uLawg8XXf5Rcl1cw?= =?us-ascii?Q?7=2FAgxqjAQgYx2u94YAiG2PYfWhgYFnz0BGYTAEo?= =?us-ascii?Q?GefeI=2FRU6G6fLD=2Fcy6cRKBS0anF=2FF1MQPHbi4=2F2?= =?us-ascii?Q?kmE+rhQKIFusSzjOPybxVbTTblKLOKGfQUeGz7y?= =?us-ascii?Q?EnzCjh7ur57hKlG2i92bMatj1VXPlZ2l8CmXhyl?= =?us-ascii?Q?SqNNEgAfdMaH6LQj4=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 102534 Subject: [ruby-core:102534] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #17591 has been updated by Eregon (Benoit Daloze). kou (Kouhei Sutou) wrote in #note-4: > test-unit 3.4.0 enables it by default. Great to hear! I wonder if it would make sense to include test-unit 3.4.0 in the next Ruby 2.7 release (e.g., 2.7.3)? Do you know if test/unit users typically use the stdlib version or a newer version from the Gemfile? --- I filed an issue for RSpec: https://github.com/rspec/rspec-core/issues/2867 ---------------------------------------- Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default https://bugs.ruby-lang.org/issues/17591#change-90434 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal ---------------------------------------- Various people in #16345 said that: > The issue can be mitigated if all test frameworks enable all deprecation warnings. > The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically. And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2. However, it seems no test frameworks or REPLs actually show deprecation warnings by default! So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0. I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do. Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`. Same for `test/unit` 3.3.4 shipped with 2.7.2. IRB in 2.7.2 does not show deprecated warnings. Same for `pry`. I think ruby-core needs to have a clear message here, like: > All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`. > This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version. > Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`. And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples. P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`. -- https://bugs.ruby-lang.org/