Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82065

Re: module import questions and question about pytest and module imports

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!diablo1.news.osn.de!news.osn.de!diablo2.news.osn.de!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.016
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'sys': 0.07; 'subject:module': 0.09; 'subject:question': 0.10; '__init__.py': 0.16; 'pytest': 0.16; 'say.': 0.16; 'subject: \n ': 0.16; 'subject:import': 0.16; 'subject:questions': 0.16; 'sys.path': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'import': 0.22; 'header :User-Agent:1': 0.23; 'directory.': 0.24; 'this:': 0.26; 'header :In-Reply-To:1': 0.27; 'idea': 0.28; 'statement': 0.30; 'guess': 0.33; 'there': 0.35; 'should': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; "you're": 0.61; 'received:74.208': 0.68; 'sam': 0.68; 'statement,': 0.68; 'examine': 0.93
Date Sun, 07 Dec 2014 11:26:23 -0500
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
MIME-Version 1.0
To python-list@python.org
Subject Re: module import questions and question about pytest and module imports
References <CAPti5iMacuhtNhGg_YkqdkW+X36R6bzRTo_RWn-KMq0CwczAOQ@mail.gmail.com>
In-Reply-To <CAPti5iMacuhtNhGg_YkqdkW+X36R6bzRTo_RWn-KMq0CwczAOQ@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:mEagUX1/jNhNQuJgJpzHaxDye7Vusy/2RxHmtiNxp0O l7FUQSc5Kc6RIDPGScUM07xxgVwnuLJ7JMTmf9xoW/pa8IJuzB D66TN1pGKQ0T69cxbbkGcf/gFsXWN/PVRRkVjxNXZSVU2kcwL5 D4EsqL5LjLqOKoyMLG2nmiRBVWeLbVjegNoQZPKJuD8Dur4K2b 4EZ03CyVNl2MBnQP8Se6IJNuPqdr6KGYL55reKKr8skPfQSj4X B7/UM4bIx/cOb31+IyZWHsjlk6rL9XNgiLPbFpKsEypfRK7jbf GThXGC7GumjRSm07uW71BGsdR7/WoYBZVHbdj76GSd+HSAwvIt uFoR6jYPZxM2UmyB5zpY=
X-UI-Out-Filterresults notjunk:1;
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.16675.1417969603.18130.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1417969603 news.xs4all.nl 2835 [2001:888:2000:d::a6]:44626
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:82065

Show key headers only | View raw


On 12/05/2014 11:50 PM, sam pendleton wrote:
> garage/
>      |- __init__.py
>      |- cars/
>          |- __init__.py
>          |- hummer.py
> tests/
>      |- test_cars.py
>
> at the top of test_cars.py, there is this:
>      from garage.cars import hummer
>
> pytest is on this import statement, so i guess it's incorrect.

No idea what that statement is trying to say.

>
> what should it be?

If you're going to import something, it either has to be on the 
sys.path, or in the current directory.  Is garage/ on your sys.path?

You can examine sys.path  by
    import sys
    print(sys.path)


-- 
DaveA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: module import questions and question about pytest and module imports Dave Angel <davea@davea.name> - 2014-12-07 11:26 -0500

csiph-web