[issue8547] unittest test discovery can fail when package under test is also installed globally
Changes by Michael Foord mich...@voidspace.org.uk: -- resolution: - accepted stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8547 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8547] unittest test discovery can fail when package under test is also installed globally
Michael Foord mich...@voidspace.org.uk added the comment: Committed revision 80932. Still needs documenting, so leaving open for the moment. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8547 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8547] unittest test discovery can fail when package under test is also installed globally
Benjamin Peterson benja...@python.org added the comment: Reverted this in r80939. See http://python.org/dev/buildbot/stable/builders/x86%20XP-4%20trunk/builds/3553/steps/test/logs/stdio -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8547 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8547] unittest test discovery can fail when package under test is also installed globally
Michael Foord mich...@voidspace.org.uk added the comment: Committed again revision 80946 after getting the tests to pass on Windows. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8547 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8547] unittest test discovery can fail when package under test is also installed globally
holger krekel holger.kre...@gmail.com added the comment: FWIW checking if an imported module really comes from a certain location and erroring out is also how py.test does it. -- nosy: +hpk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8547 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8547] unittest test discovery can fail when package under test is also installed globally
Michael Foord mich...@voidspace.org.uk added the comment: Sounds like the right approach then. :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8547 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8547] unittest test discovery can fail when package under test is also installed globally
New submission from Michael Foord mich...@voidspace.org.uk: When test discovery is invoked on a package on the filesystem which is also installed in site-packages then importing the tests will look in the installed version. This causes discovery to run the wrong tests or fail. We can detect this (compare the __file__ against the expected location) and also insert the top level path as the first location in sys.path instead of appending it to the end. If we detect a failed import then we should error out with an appropriate message. (Nose gets round this by patching __import__ to import from a specific location which seems potentially fragile.) -- assignee: michael.foord components: Library (Lib) messages: 104313 nosy: michael.foord priority: normal severity: normal stage: needs patch status: open title: unittest test discovery can fail when package under test is also installed globally type: behavior versions: Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8547 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com