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=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham 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 12D211F9FD for ; Wed, 17 Feb 2021 08:07:00 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id D842A120B02; Wed, 17 Feb 2021 17:06:01 +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 A5936120AF4 for ; Wed, 17 Feb 2021 17:05:59 +0900 (JST) Received: by filterdrecv-p3las1-c477c4585-4pp7h with SMTP id filterdrecv-p3las1-c477c4585-4pp7h-19-602CCE97-48 2021-02-17 08:06:47.659377302 +0000 UTC m=+638327.296379847 Received: from herokuapp.com (unknown) by ismtpd0067p1mdw1.sendgrid.net (SG) with ESMTP id O9gaxRhPQESb1UY-1o6_7Q for ; Wed, 17 Feb 2021 08:06:47.549 +0000 (UTC) Date: Wed, 17 Feb 2021 08:06:47 +0000 (UTC) From: kou@cozmixng.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 78481 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Misc X-Redmine-Issue-Id: 17591 X-Redmine-Issue-Author: Eregon X-Redmine-Sender: kou 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?OgCtJ0S3gkqIDZ0y6NurOwkms=2FhwVHU2KHZvf7rQCeK8KzsUB8f0EyJGTcRjaS?= =?us-ascii?Q?8YBZCGdf=2FkbHcpw74ZU+fSzrB8W9SjhxGCudLHe?= =?us-ascii?Q?Pwff4=2F5oo=2Fcy90Y6UwzKfwFPZ6PDzpHLnwnBkCG?= =?us-ascii?Q?kIgEwBF7RdfEUiOGVQuTryk61jj4UpMB6m+dPIb?= =?us-ascii?Q?MsjF1G=2FSEPOh54qbKLfd3Pd=2FICY1cTyRI43rSaj?= =?us-ascii?Q?C340KHwM3WmegxygQ=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 102552 Subject: [ruby-core:102552] [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 kou (Kouhei Sutou). > 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)? @nagachika What do you think about > Do you know if test/unit users typically use the stdlib version or a newer version from the Gemfile? Maybe most users specify `gem "test-unit"` in their Gemfile. If an user uses Gemfile, the user can't use test-unit without specifying `gem "test-unit"` in Gemfile. Maybe many users are using Gemfile. ---------------------------------------- Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default https://bugs.ruby-lang.org/issues/17591#change-90454 * 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/