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

Error while importing overrided module #242

Closed
pytestbot opened this issue Dec 20, 2012 · 5 comments
Closed

Error while importing overrided module #242

pytestbot opened this issue Dec 20, 2012 · 5 comments
Labels
plugin: cache related to the cache builtin plugin type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Wojciech Daniło (BitBucket: wdanilo, GitHub: wdanilo)


Hi!
I'm creating a plugin manager system 'pluginmate' for Python (with ideas based on pyutilib pca and envisage).
(you can find it here, but it is in early, development stage: https://github.com/wdanilo/pluginmate)

When importing the main module, the sys.modules['pluginmate'] is overriden with a class instance. Maybe this is not beautifull, but it gives me some cool features.

The problem is, when running tests, everything works if .pyc files are not generated. After they are generated I've got error. Full error stack can be found here: http://bpaste.net/show/65558

The problem does not exist after running tests the first time after changing the 'libs/utils/moduleUtils.py' file (the file responsible for overriding the module), so the error is connected with some kind of .pyc files caching by py.test


@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


cant be replicated on python 2.x

you might want to add arguments to super() calls so it can be executed on older pythons

i suppose we need to investigate if python3 broke something wrt importing again

@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


additional interesting effect - if import pluginmate is added at the top of the module, it works on python3.2

@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


can this be closed?

@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


no idea.

@pytestbot
Copy link
Contributor Author

Original comment by Wojciech Daniło (BitBucket: wdanilo, GitHub: wdanilo):


I think this could be closed. There is no sufficent test cases for that, and the architecture of pluginmate do not need more such functionality and everythink works as should. If in the future we will see this bug again, it will be reopened.

@pytestbot pytestbot added type: bug problem that needs to be addressed plugin: cache related to the cache builtin plugin labels Jun 15, 2015
fkohlgrueber pushed a commit to fkohlgrueber/pytest that referenced this issue Oct 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: cache related to the cache builtin plugin type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant