Two files with the same name conflict

Issue #59 resolved
glanton created an issue

If there are two files with the same name in different directories, py.test will not behave correctly. See the attached file for an example. In this case both tests pass, when one should fail.

Comments (2)

  1. Holger Krekel repo owner
    • changed status to open

    Thanks for reporting it with a failure case!

    indeed, py.test uses the normal import mechanism and your two "test_whatever" modules both try to live in a top-level namespace. If you add an init.py file to the a and b directories the imports will work.

    However, it's certainly bad that this conflict-naming situation passes silently so i made this situation raise an error now that looks like this:

    http://paste.pocoo.org/show/147569/

    see the changeset here:

    http://bitbucket.org/hpk42/py-trunk/changeset/78979cd0cdec/

    The error presentation is not totally nice but i hope it's understandable. If you agree it'd be nice if you set this issue to "resolved". thanks & best, holger

  2. Log in to comment