Two files with the same name conflict

Create issue
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 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:

    see the changeset here:

    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