Merge branch 'mromberg-relative'

* mromberg-relative:
  Python: Do not import all of sys when using -relativeimport
  Add missing print statements to the Python import_packages tests
  Update -relative import documentation to reflect runtime check.
  > to >=
  Make the check for python3 -relative does python runtime check.
This commit is contained in:
William S Fulton 2016-06-06 22:23:27 +01:00
commit 98e2132c0b
5 changed files with 42 additions and 22 deletions

View file

@ -1,8 +1,17 @@
# These examples rely on namespace packages. Don't
# run them for old python interpreters.
import sys
import os.path
testname = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
print "Testing " + testname + " - namespace packages"
if sys.version_info < (3, 3, 0):
print " Not importing nstest as Python version is < 3.3"
sys.exit(0)
import nstest
print " Finished importing nstest"
nstest.main()

View file

@ -1,3 +1,10 @@
import os.path
testname = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
print "Testing " + testname + " - split modules"
import pkg1.foo
print " Finished importing pkg1.foo"
assert(pkg1.foo.count() == 3)

View file

@ -1,3 +1,10 @@
import os.path
testname = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
print "Testing " + testname + " - split modules"
import pkg1.foo
print " Finished importing pkg1.foo"
assert(pkg1.foo.count() == 3)