From owner-freebsd-python@freebsd.org  Fri Nov 15 01:05:25 2019
Return-Path: <owner-freebsd-python@freebsd.org>
Delivered-To: freebsd-python@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86A311B7C73
 for <freebsd-python@mailman.nyi.freebsd.org>;
 Fri, 15 Nov 2019 01:05:25 +0000 (UTC)
 (envelope-from koobs.freebsd@gmail.com)
Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::50:13])
 by mx1.freebsd.org (Postfix) with ESMTP id 47DgBY22FHz4LGv
 for <freebsd-python@freebsd.org>; Fri, 15 Nov 2019 01:05:25 +0000 (UTC)
 (envelope-from koobs.freebsd@gmail.com)
Received: by mailman.nyi.freebsd.org (Postfix)
 id 4592D1B7C6F; Fri, 15 Nov 2019 01:05:25 +0000 (UTC)
Delivered-To: python@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4522A1B7C6E;
 Fri, 15 Nov 2019 01:05:25 +0000 (UTC)
 (envelope-from koobs.freebsd@gmail.com)
Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com
 [IPv6:2607:f8b0:4864:20::42b])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (2048 bits) client-digest SHA256)
 (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 47DgBX2PPTz4LGZ;
 Fri, 15 Nov 2019 01:05:24 +0000 (UTC)
 (envelope-from koobs.freebsd@gmail.com)
Received: by mail-pf1-x42b.google.com with SMTP id x28so5485688pfo.6;
 Thu, 14 Nov 2019 17:05:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:reply-to:subject:to:references:from:message-id:date
 :user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=c/JkGZV5nr7xhkloGDXJa0qKYbKfiOkXjQqfDY2FCSw=;
 b=dCIOLOiHd4I2n50fUhR/q/tAR1oHUp+GYXwLyIDZwR16gXh0QQuwCE/ampdtit7j/a
 mHVAL9ROJWFsopoq4WljRM7V4RyKHv3dSI2VD3DSalAs18vs0qRb5CBXVNSeXzcUbMC+
 tNwmUL0G5clJ9TtsBAfoX7b/G58kj2Tk27aaL9RzCufls5ifS+thF2QF3GSM+XCWf26F
 OwwnVyPQlGWj7qU/AXPzgkAymmgN1afwH+kD5I+YKFe5+9XknhXU/ZtuX88I1d7gxLOL
 Z/Zlm0I/zTixiX57AQ8Cqv/IyjT94GscOtYxGFAJ7MLqXFLGe4BCIxtA5iyXELcSXyCB
 1BWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:reply-to:subject:to:references:from
 :message-id:date:user-agent:mime-version:in-reply-to
 :content-language:content-transfer-encoding;
 bh=c/JkGZV5nr7xhkloGDXJa0qKYbKfiOkXjQqfDY2FCSw=;
 b=UJT8+OZvXJnYMMu74N2VegfezAvLP6ZIbjRwb9hWJ0wIW6Iw0Ddh3YNJmFd9Lz4NsB
 Urt5Ni7a362BZK1w6IVgxaKBPefsby567Eeid/NyH8rKdQYHuNWzMP3c7yqc2H7Y7QVr
 u291lJFpeda9l12zXtctFA6utCzgKyiTB9xPrQsEq8w4oXyVO29CoHPs77biE6jWR6vc
 B34XGm6HUpB4a/TwZepALCsgU94GkWQ0SwBb6KyaIwNTXHMhS2WQOnWqYkYSNpfyL8Gf
 c7OHF4yL0UqVxTgX87QMX8cXshtaR44jinwluFYZW5GlypuQZBlIztKf7EGqNHyA43BK
 7A+g==
X-Gm-Message-State: APjAAAWfBsu3e2D+/UMvEnk+yIPjpTJ0NDU2fQbcxx8pOWdvha1SD7Ag
 gYRnAxMKrrBViUguTBh9bWIc6sb1
X-Google-Smtp-Source: APXvYqzf0vxczU1y+U+zmYgkDBPkf+KLIAgco/H5/Yv1v5BS/MJLmqrwt6h71iJQBDyHdlUszBj/8Q==
X-Received: by 2002:a63:5801:: with SMTP id m1mr13141944pgb.139.1573779922202; 
 Thu, 14 Nov 2019 17:05:22 -0800 (PST)
Received: from [192.168.1.110] (180-150-68-130.b49644.syd.nbn.aussiebb.net.
 [180.150.68.130])
 by smtp.gmail.com with ESMTPSA id y14sm7949901pff.69.2019.11.14.17.05.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 14 Nov 2019 17:05:21 -0800 (PST)
Sender: Kubilay Kocak <koobs.freebsd@gmail.com>
Reply-To: koobs@FreeBSD.org
Subject: Re: svn commit: r517602 - head/devel/py-mock
To: Enji Cooper <ngie@FreeBSD.org>, ports-committers@freebsd.org,
 svn-ports-all@freebsd.org, svn-ports-head@freebsd.org,
 python <python@FreeBSD.org>
References: <201911141711.xAEHBwBO077712@repo.freebsd.org>
From: Kubilay Kocak <koobs@FreeBSD.org>
Message-ID: <6f252ffe-9e8d-3bb7-fe48-baccda10012d@FreeBSD.org>
Date: Fri, 15 Nov 2019 12:05:18 +1100
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101
 Thunderbird/71.0
MIME-Version: 1.0
In-Reply-To: <201911141711.xAEHBwBO077712@repo.freebsd.org>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Rspamd-Queue-Id: 47DgBX2PPTz4LGZ
X-Spamd-Bar: ----
Authentication-Results: mx1.freebsd.org;
 dkim=pass header.d=gmail.com header.s=20161025 header.b=dCIOLOiH;
 dmarc=none;
 spf=pass (mx1.freebsd.org: domain of koobsfreebsd@gmail.com designates
 2607:f8b0:4864:20::42b as permitted sender)
 smtp.mailfrom=koobsfreebsd@gmail.com
X-Spamd-Result: default: False [-4.86 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[];
 HAS_REPLYTO(0.00)[koobs@FreeBSD.org]; TO_DN_SOME(0.00)[];
 R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36];
 REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5];
 RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+];
 FORGED_SENDER(0.30)[koobs@FreeBSD.org,koobsfreebsd@gmail.com];
 IP_SCORE(-2.66)[ip: (-8.96), ipnet: 2607:f8b0::/32(-2.32), asn: 15169(-1.99),
 country: US(-0.05)]; MIME_TRACE(0.00)[0:+];
 FREEMAIL_ENVFROM(0.00)[gmail.com];
 FROM_NEQ_ENVFROM(0.00)[koobs@FreeBSD.org,koobsfreebsd@gmail.com];
 MID_RHS_MATCH_FROM(0.00)[];
 ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US];
 ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0];
 R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; TAGGED_FROM(0.00)[];
 FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];
 NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain];
 DMARC_NA(0.00)[FreeBSD.org];
 RCVD_IN_DNSWL_NONE(0.00)[b.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org
 : 127.0.5.0]; RCVD_TLS_ALL(0.00)[]
X-BeenThere: freebsd-python@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FreeBSD-specific Python issues <freebsd-python.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-python>, 
 <mailto:freebsd-python-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-python/>
List-Post: <mailto:freebsd-python@freebsd.org>
List-Help: <mailto:freebsd-python-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-python>,
 <mailto:freebsd-python-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 15 Nov 2019 01:05:25 -0000

On 15/11/2019 4:11 am, Enji Cooper wrote:
> +	@cd ${WRKSRC} && pytest

Hi Enji :)

Python ports *must* always reference/use *Python-version* specific 
versions of binaries/scripts/interpreters for *all* invocations of them, 
as it can never be guaranteed that:

a) A/the non-versioned binary name is installed, and
b) That the non-versioned binary name points to expected (same) version 
as the port is being tested/built with.

The canonical pytest invocation is:

cd ${WRKSRC} && ${PYTHON_CMD} -m pytest -v -rs -o addopts=

-v: one line per test (rather than dots per test)
-rs: Show skip/skipped reasons
-o addopts=: Override setup.cfg/pytest.ini options that sometimes set 
arguments that require additional dependencies (--cov for coverage) or 
other test arguments that we dont want)

Note: Some Python packages 'require' or 'depend on' invoking the pytest 
script directly, as the python path semantics of this differ from using 
pythonX.Y -m pytest, but try to use the first one unless it doesn't work.

In these cases, the correct invocation is usually:

cd ${WRKSRC} && ${LOCALBASE}/bin/pytest-${PYTHON_VER} -v -rs -o addopts=