Path: csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod From: Sao I Kuan Newsgroups: linux.debian.maint.python Subject: Re: Questions about including tests/ directory into package Date: Fri, 20 Mar 2020 12:30:02 +0100 Message-ID: References: X-Original-To: Diane Trout X-Mailbox-Line: From debian-python-request@lists.debian.org Fri Mar 20 11:22:41 2020 Old-Return-Path: X-Amavis-Spam-Status: No, score=-6.199 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, GMAIL=1, LDO_WHITELIST=-5, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no X-Policyd-Weight: using cached result; rate: -5.5 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6F9CTu/kgV/YPnprqLK71ruW+9axufLYVBynaSmn65g=; b=AfCoqsvQI6+WNjr5s6LoGD+9U3tczsoAyW/rc496T8XV0szfomzxFt7EdLB9FwxFWe +zp6JJZCwIr/cm/0GjAZp3Zd+K/aTv1PS9+5JvUXdTi/83NYY+OlbOrOxPiStPxAAydD RK1G7NM79cqHrBCb0wvv43AZq/hOpSDA7Ty0331a2F/kSjjMiqdx99O2PLH0Ybp0tkk0 E0BCuPf7j9Y2YREhC2UfsqSIGH2re5vo8vMK3ZZOKa/9aTa1jxdbpLh+nna4UrX9gGkO IuEAn054alrTkSn5YFl867j2ZX+Be63aPdjCV+Aq6wqtBkV8WenoqnU+8mmpp1zj1l09 EY0g== X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6F9CTu/kgV/YPnprqLK71ruW+9axufLYVBynaSmn65g=; b=lBA99zMWzlXzKmTQOl8EpAQNmZJmOILi9NtuC0y8xqzbXT6zGQk2xb1WEjz5sVsv7S W/6KX9lOmqvOjEm09Bhy2pM7P1seZGvlzJbs2L6ex0c2LPkCTurW5qlazYoLtBZztzk/ bLes+Oiy8hDrVx6HsYVm72IiB1mZ1EHoX4P5lHFdt1FOmyxG9P/cLSXQ9X8wHAOi3nCU 6dE8dNGL0jaUZHkn/1bmIx3/W3VDY6xUZ18BfCr6/gmkFyUOE0PwQB8D7Q+P6jpcY9WB JzH0jj1LIneqRocFIsO15wGcwZGUMorbimdfrvKldWijyXTEzJRHxDcjHhSHQvDuwJpG wigg== X-Gm-Message-State: ANhLgQ2pNVtBjrCAPdbAvmcTBQhaGejjZ2epgMmJs+u5gjTsGTpGQayo inmXI+c3cdvslMA+CDCNyp2AU9Dw3psilT71HIuv6ZGr X-Google-SMTP-Source: ADFU+vu/c9W8gp7zCaxzHofiW6bvA6rnKTvKFi+siFj/FDw49W7G/EI1AvLe2tE3K2X4vCi/z/nDcXQS3peQoX430v0= X-Received: by 2002:a1f:73cd:: with SMTP id o196mr5580666vkc.52.1584703345946; Fri, 20 Mar 2020 04:22:25 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Mailing-List: archive/latest/18015 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/CAGzOMC_-fk1PUi=hzBVDu0ML2X-sv_gseZf=B_UA_wnDnNzi9A@mail.gmail.com Approved: robomod@news.nic.it Lines: 31 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: debian-python@lists.debian.org X-Original-Date: Fri, 20 Mar 2020 20:22:14 +0900 X-Original-Message-ID: X-Original-References: <519df6b3a6d0a62b37a7aab109e534cd6a0f2c42.camel@ghic.org> Xref: csiph.com linux.debian.maint.python:12371 On Fri, Mar 20, 2020 at 2:38 AM Diane Trout wrote: > The way I solved that problem in a similar package was this > > Test-Command: set -e > ; for py in $(py3versions -r 2>/dev/null) > ; do cd tests > ; echo "Testing with $py in $(pwd):" > ; http_proxy= $py -m pytest -v --pyargs > ; done > Depends: @, python3-all, python3-pytest > > The goal of autopkgtests is to test the installed package, when > autopkgtest starts running it defaults to starting in the extracted > copy of the source package. > > The goal is to make sure you test the copy in /usr/lib/python*/dist- > packages. So I assumed if cd-ed into the tests directory the package > source module wouldn't be available to the test runner. > > I did make the assumption that none of the tests messed with the python > path to look in the parent directory... Thanks, Diane. I tried with your given example, it really helped. A lot of appreciates. Thanks for your kind and deep explanation. Sincerely, Sao I Kuan saoikuan@gmail.com