diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2014-10-06 21:32:05 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2014-10-07 20:58:40 +0100 |
commit | a9c6196f7120a12a6d3a46adef6814a2dc7a878d (patch) | |
tree | cc88922aa1647087f5cc77065bc9ce0004e97f0f /Examples/python | |
parent | 9834a69c18478fdc3b78ba52faabf7c551aef531 (diff) | |
download | swig-a9c6196f7120a12a6d3a46adef6814a2dc7a878d.tar.gz |
Display testname when running the import_packages Python examples
For easier identification of what is running in these examples.
Diffstat (limited to 'Examples/python')
8 files changed, 46 insertions, 13 deletions
diff --git a/Examples/python/import_packages/from_init1/runme.py b/Examples/python/import_packages/from_init1/runme.py index c23a085fa..bbe092bab 100644 --- a/Examples/python/import_packages/from_init1/runme.py +++ b/Examples/python/import_packages/from_init1/runme.py @@ -1,6 +1,10 @@ -# Test import of modules content from within __init__.py -print "Testing %module(package=...) + python 'import' in __init__.py" import sys +import os.path + +# Test import of modules content from within __init__.py +testname = os.path.basename(os.path.dirname(os.path.abspath(__file__))) +print "Testing " + testname + " - %module(package=...) + python 'import' in __init__.py" + if sys.version_info < (3,0): import py2.pkg2 print " Finished importing py2.pkg2" diff --git a/Examples/python/import_packages/from_init2/runme.py b/Examples/python/import_packages/from_init2/runme.py index c23a085fa..bbe092bab 100644 --- a/Examples/python/import_packages/from_init2/runme.py +++ b/Examples/python/import_packages/from_init2/runme.py @@ -1,6 +1,10 @@ -# Test import of modules content from within __init__.py -print "Testing %module(package=...) + python 'import' in __init__.py" import sys +import os.path + +# Test import of modules content from within __init__.py +testname = os.path.basename(os.path.dirname(os.path.abspath(__file__))) +print "Testing " + testname + " - %module(package=...) + python 'import' in __init__.py" + if sys.version_info < (3,0): import py2.pkg2 print " Finished importing py2.pkg2" diff --git a/Examples/python/import_packages/from_init3/runme.py b/Examples/python/import_packages/from_init3/runme.py index c23a085fa..bbe092bab 100644 --- a/Examples/python/import_packages/from_init3/runme.py +++ b/Examples/python/import_packages/from_init3/runme.py @@ -1,6 +1,10 @@ -# Test import of modules content from within __init__.py -print "Testing %module(package=...) + python 'import' in __init__.py" import sys +import os.path + +# Test import of modules content from within __init__.py +testname = os.path.basename(os.path.dirname(os.path.abspath(__file__))) +print "Testing " + testname + " - %module(package=...) + python 'import' in __init__.py" + if sys.version_info < (3,0): import py2.pkg2 print " Finished importing py2.pkg2" diff --git a/Examples/python/import_packages/relativeimport1/runme.py b/Examples/python/import_packages/relativeimport1/runme.py index 44ce8d1c4..99b6e513e 100644 --- a/Examples/python/import_packages/relativeimport1/runme.py +++ b/Examples/python/import_packages/relativeimport1/runme.py @@ -1,6 +1,10 @@ -# Test import of modules content from within __init__.py -print "Testing %module(package=...) with -relativeimport" import sys +import os.path + +# Test import of modules content from within __init__.py +testname = os.path.basename(os.path.dirname(os.path.abspath(__file__))) +print "Testing " + testname + " - %module(package=...) with -relativeimport" + if sys.version_info < (3,0): import py2.pkg2.bar print " Finished importing py2.pkg2.bar" diff --git a/Examples/python/import_packages/relativeimport2/runme.py b/Examples/python/import_packages/relativeimport2/runme.py index ac60eb630..f0ab6c446 100644 --- a/Examples/python/import_packages/relativeimport2/runme.py +++ b/Examples/python/import_packages/relativeimport2/runme.py @@ -1,6 +1,10 @@ -# Test import of modules content from within __init__.py -print "Testing %module(package=...) + python 'import' in __init__.py" import sys +import os.path + +# Test import of modules content from within __init__.py +testname = os.path.basename(os.path.dirname(os.path.abspath(__file__))) +print "Testing " + testname + " - %module(package=...) + python 'import' in __init__.py" + if sys.version_info < (3,0): import py2.pkg2.bar print " Finished importing py2.pkg2.bar" diff --git a/Examples/python/import_packages/relativeimport3/runme.py b/Examples/python/import_packages/relativeimport3/runme.py index 44ce8d1c4..99b6e513e 100644 --- a/Examples/python/import_packages/relativeimport3/runme.py +++ b/Examples/python/import_packages/relativeimport3/runme.py @@ -1,6 +1,10 @@ -# Test import of modules content from within __init__.py -print "Testing %module(package=...) with -relativeimport" import sys +import os.path + +# Test import of modules content from within __init__.py +testname = os.path.basename(os.path.dirname(os.path.abspath(__file__))) +print "Testing " + testname + " - %module(package=...) with -relativeimport" + if sys.version_info < (3,0): import py2.pkg2.bar print " Finished importing py2.pkg2.bar" diff --git a/Examples/python/import_packages/same_modnames1/runme.py b/Examples/python/import_packages/same_modnames1/runme.py index 923f0e0bb..7bec1ec1e 100644 --- a/Examples/python/import_packages/same_modnames1/runme.py +++ b/Examples/python/import_packages/same_modnames1/runme.py @@ -1,5 +1,9 @@ +import os.path + # Test import of same modules from different packages -print "Testing %module(package=...) + %import + same modules in different packages" +testname = os.path.basename(os.path.dirname(os.path.abspath(__file__))) +print "Testing " + testname + " - %module(package=...) + python 'import' in __init__.py" + import pkg2.foo print " Finished importing pkg2.foo" diff --git a/Examples/python/import_packages/same_modnames2/runme.py b/Examples/python/import_packages/same_modnames2/runme.py index af8f78194..eec6121eb 100644 --- a/Examples/python/import_packages/same_modnames2/runme.py +++ b/Examples/python/import_packages/same_modnames2/runme.py @@ -1,3 +1,8 @@ +import os.path + +testname = os.path.basename(os.path.dirname(os.path.abspath(__file__))) +print "Testing " + testname + " - %module(package=...) + python 'import' in __init__.py" + import pkg1.pkg2.foo print " Finished importing pkg1.pkg2.foo" |