Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests get different fully-dotted names depending on the discovery-method used. #14

Closed
CleanCut opened this issue Jun 24, 2014 · 3 comments
Assignees
Labels

Comments

@CleanCut
Copy link
Owner

Test discovery sometimes gives pkg.module.submodule... when some discovery methods are used, and for others it gives submodule...

This is mildly annoying for regular output, but incredibly frustrating when trying to implement output for bash/zsh completion in #7.

This has got to be fixed. I hope I don't have to rewrite all of test discovery.

@CleanCut CleanCut added the bug label Jun 24, 2014
@CleanCut CleanCut self-assigned this Jun 24, 2014
@CleanCut
Copy link
Owner Author

Here's the loading strategies and what they end up with:

DISCOVER (package name [directory]) - Does not include package name
DISCOVER (package.subpkg [directory]) - Does not include package name
DISCOVER (installed package name [directory]) - Does not include package name

DISCOVER (. outside package [current directory]) - Includes package name
DOTTED OBJECT (package.module [file]) -Includes package name
FILE (module filepath [file]) - Includes package name

@CleanCut
Copy link
Owner Author

I altered one of the existing loader unit tests to fail for this condition.

The DOTTED OBJECT strategy won't load a package by name, so I can't just switch to that instead. I'm going to have to read the unittest source and see if there's someway to influence it. If there's not, then I'm just going to have to reimplement discovery myself.

On the bright side, that would enable me to implement more features (like treating bare functions as tests if I want to). On the other hand, it's a lot of functionality to rewrite to fix a small (but important) issue.

@CleanCut
Copy link
Owner Author

CleanCut commented Jul 2, 2014

Okay, this is bugging me. A lot. I have tried to solve this problem three different times in three different ways, and hit a dead end on all of them.

The built-in unittest stuff is a mess. Sorry python, but it's true. I'm going to start an experimental branch to start writing my own test discovery. Maybe along the way I'll discover how to fix it without my own discovery.

CleanCut added a commit that referenced this issue Jul 3, 2014
CleanCut added a commit that referenced this issue Jul 3, 2014
…g my own discover process, to further distance myself from unittest's craziness (a possible way to solve #14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant