On Fri, Aug 19, 2016, at 18:10, Chris Angelico wrote: > On Sat, Aug 20, 2016 at 8:07 AM, Sjoerd Job Postmus <sjoerd...@sjec.nl> > wrote: > > I'd like to re-iterate my suggestion in case it was missed: split the > > current test in 2 tests: > > > > * Running with `-S` which is for checking that by default the collections > > are not imported. (Which is what is currently tested) > > * Running without `-S` which is for checking that `site` gets imported. > > > > I hope that is clear enough. Do you see any problems with such an approach? > > AIUI this wouldn't test that site is sufficiently slim. The test is > supposed to mimic normal startup, then assert that unnecessary modules > haven't been loaded. Splitting it would prove that a -S run is nice > and slim, but would allow bloat in site.py to pass unnoticed.
What about -S and putting "import site" explicitly in the test code? Or would that go back to importing everything on people who have packages installed? Really, there should be a "source-isolated" mode, which removes /usr/lib/whatever from the path in the same way that -I removes the user's stuff, but still runs cpython/Lib/site.py , and all tests (and for that matter stuff like frozen module prep) should be run in this mode. I'm not sure I see a downside to having such a mode be the *default* mode for "python detects it is being run from a source tree". _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com