module import questions and question about pytest and module imports

sam pendleton samp4040 at gmail.com
Fri Dec 5 23:50:09 EST 2014


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.

what should it be?

if i open a python repl within tests/, how can i say import hummer.py?

do i need to do anything to make pytest aware of hummer.py?

thanks for the help!



More information about the Python-list mailing list