Skip to content

warn about invalid test module names #1426

Closed
@cztomczak

Description

@cztomczak

PyTest throws import errors when there are dots in my files:

c:\github\pycef\unittests>py.test
============================= test session starts =============================
platform win32 -- Python 2.7.11, pytest-2.9.0, py-1.4.31, pluggy-0.3.1
rootdir: c:\github\pycef\unittests, inifile: pytest.ini
collected 0 items / 8 errors

=================================== ERRORS ====================================
______________________ ERROR collecting app.Settings.py _______________________
c:\python27\lib\site-packages\py\_path\local.py:650: in pyimport
    __import__(modname)
E   ImportError: No module named app.Settings
______________________ ERROR collecting app.Switches.py _______________________
c:\python27\lib\site-packages\py\_path\local.py:650: in pyimport
    __import__(modname)
E   ImportError: No module named app.Switches
_____________________ ERROR collecting browser.Browser.py _____________________
c:\python27\lib\site-packages\py\_path\local.py:650: in pyimport
    __import__(modname)
E   ImportError: No module named browser.Browser
_________________ ERROR collecting browser.BrowserSettings.py _________________
c:\python27\lib\site-packages\py\_path\local.py:650: in pyimport
    __import__(modname)
E   ImportError: No module named browser.BrowserSettings
____________________ ERROR collecting browser.Embedder.py _____________________
c:\python27\lib\site-packages\py\_path\local.py:650: in pyimport
    __import__(modname)
E   ImportError: No module named browser.Embedder

Scripts run fine when executed from command line:

python app.Settings.py

It is only PyTest having problems running them.

Python 2.7 32-bit.
OS: Win7 Pro SP1

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortopic: collectionrelated to the collection phasetopic: reportingrelated to terminal output and user-facing messages and errors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions