[issue16817] test___all__ affects other tests by doing too much importing

2018-07-21 Thread Matej Cepl


Matej Cepl  added the comment:

> This is superceded by:
> 
> http://bugs.python.org/issue18906

Then it should be closed, right?

--
nosy: +mcepl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16817] test___all__ affects other tests by doing too much importing

2013-10-08 Thread Eli Bendersky

Eli Bendersky added the comment:

This is superceded by:

http://bugs.python.org/issue18906

--
superseder:  - Create a way to always run tests in subprocesses within regrtest

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16817
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16817] test___all__ affects other tests by doing too much importing

2013-01-26 Thread Eli Bendersky

Eli Bendersky added the comment:

Eric, yes the key code in test_xml_etree that handles this is:

def pickleRoundTrip(self, obj, name, dumper, loader):
save_m = sys.modules[name]
try:
sys.modules[name] = dumper
temp = pickle.dumps(obj)
sys.modules[name] = loader
result = pickle.loads(temp)
except pickle.PicklingError as pe:
# pyET must be second, because pyET may be (equal to) ET.
human = dict([(ET, cET), (pyET, pyET)])
raise support.TestFailed(Failed to round-trip %r from %r to %r
 % (obj,
human.get(dumper, dumper),
human.get(loader, loader))) from pe
finally:
sys.modules[name] = save_m
return result

Because pickle does its own import of ElementTree.

The test___all__ problem should be solved by a patch to issue #1674555, but 
having a separate mechanism in test.support was discussed. I'll take a look at 
your decorator.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16817
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16817] test___all__ affects other tests by doing too much importing

2013-01-26 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16817
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16817] test___all__ affects other tests by doing too much importing

2013-01-25 Thread Eric Snow

Eric Snow added the comment:

So the current solution is to temporarily put the relevant module in place in 
sys.modules, right?  That seems to be the solution that Stefan recommended and 
used in the decimal module.  Sounds good to me.

I'm hitting this while doing the PEP 399 two-step for the collections module.  
It seems like this will be a problem for testing any module that has had such 
attention and has __all__.  I'd be a fan of a class decorator that would take 
care of this and the rest of the PEP 399 stuff for you.

I've created issue #17037 to cover that (so it doesn't get muddled in with this 
discussion of test___all__).  There's even a proposed patch.

--
nosy: +eric.snow

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16817
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16817] test___all__ affects other tests by doing too much importing

2013-01-05 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
dependencies: +sys.path in tests contains system directories

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16817
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16817] test___all__ affects other tests by doing too much importing

2012-12-30 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
title: test___all__ has to save and restore sys.modules while it does all the 
importing - test___all__ affects other tests by doing too much importing

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16817
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com