19 May
2015
19 May
'15
12:15 a.m.
On May 18, 2015, at 10:13, Steven D'Aprano
If Ram is permitted multiple test files, then the simplest solution is to split off the code that relies on the future directive into its own file:
try: import xyz # requires the future directive except ImportError: xyz = None
if xyz: # tests with directive else: # tests without
Would this break unittest's automated discovery, setuptools' automatic test command, etc., unless you moved xyz out of the tests directory and added a sys.path.import before trying to import it? If so, that might be something worth explaining in a howto or a section of the packaging developer guide.