-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing: making some of the various test.py scripts more consistent. …
…Centralizing some of the code in testing.py. Checking that __doc__ string really exists in test_cases.py. Avoiding relative imports in test.py so that they can be called.
- Loading branch information
1 parent
09f5e69
commit f043312
Showing
10 changed files
with
214 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from snappy import testing | ||
import snappy | ||
|
||
from snappy import drilling | ||
import snappy.drilling.test_cases | ||
|
||
modules = [ | ||
drilling, | ||
drilling.test_cases | ||
] | ||
|
||
def run_doctests(verbose=False, print_info=False): | ||
globs = {'Manifold': snappy.Manifold} | ||
return testing.doctest_modules(modules, | ||
verbose=verbose, | ||
print_info=print_info, | ||
extraglobs=globs) | ||
|
||
run_doctests.__name__ = drilling.__name__ | ||
|
||
if __name__ == '__main__': | ||
testing.run_doctests_as_main(run_doctests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,31 @@ | ||
from snappy import testing | ||
import snappy | ||
import sys | ||
import getopt | ||
from . import (rational_linear_algebra, | ||
pl_utils, | ||
barycentric_geometry, | ||
hyp_utils, | ||
link_projection, | ||
mcomplex_with_memory, | ||
mcomplex_with_expansion, | ||
mcomplex_with_link, | ||
simplify_to_base_tri, | ||
put_in_S3, | ||
main) | ||
from . import __name__ as module_name | ||
|
||
modules = [rational_linear_algebra, | ||
pl_utils, | ||
barycentric_geometry, | ||
hyp_utils, | ||
link_projection, | ||
mcomplex_with_memory, | ||
mcomplex_with_expansion, | ||
mcomplex_with_link, | ||
simplify_to_base_tri, | ||
put_in_S3, | ||
main] | ||
from snappy import exterior_to_link | ||
|
||
modules = [ | ||
exterior_to_link.rational_linear_algebra, | ||
exterior_to_link.pl_utils, | ||
exterior_to_link.barycentric_geometry, | ||
exterior_to_link.hyp_utils, | ||
exterior_to_link.link_projection, | ||
exterior_to_link.mcomplex_with_memory, | ||
exterior_to_link.mcomplex_with_expansion, | ||
exterior_to_link.mcomplex_with_link, | ||
exterior_to_link.simplify_to_base_tri, | ||
exterior_to_link.put_in_S3, | ||
exterior_to_link.main | ||
] | ||
|
||
def run_doctests(verbose=False, print_info=False): | ||
globs = {'Manifold': snappy.Manifold, | ||
'Triangulation': snappy.Triangulation} | ||
results = snappy.testing.doctest_modules(modules, | ||
verbose=verbose, | ||
extraglobs=globs, | ||
print_info=print_info) | ||
return results | ||
return testing.doctest_modules(modules, | ||
verbose=verbose, | ||
print_info=print_info, | ||
extraglobs=globs) | ||
|
||
run_doctests.__name__ = module_name | ||
run_doctests.__name__ = exterior_to_link.__name__ | ||
|
||
if __name__ == '__main__': | ||
optlist, args = getopt.getopt(sys.argv[1:], 'v', ['verbose']) | ||
verbose = len(optlist) > 0 | ||
results = run_doctests(verbose, print_info=True) | ||
sys.exit(results.failed) | ||
testing.run_doctests_as_main(run_doctests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from snappy import testing | ||
import snappy | ||
|
||
from snappy import len_spec | ||
import snappy.len_spec.test_cases | ||
|
||
modules = [ | ||
len_spec, | ||
len_spec.word, | ||
len_spec.length_spectrum_geodesic_info, | ||
len_spec.test_cases | ||
] | ||
|
||
def run_doctests(verbose=False, print_info=False): | ||
globs = {'Manifold': snappy.Manifold} | ||
return testing.doctest_modules(modules, | ||
verbose=verbose, | ||
print_info=print_info, | ||
extraglobs=globs) | ||
|
||
run_doctests.__name__ = len_spec.__name__ | ||
|
||
if __name__ == '__main__': | ||
testing.run_doctests_as_main(run_doctests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from snappy import testing | ||
import snappy | ||
|
||
from snappy import raytracing | ||
|
||
modules = [ | ||
raytracing.cohomology_fractal, | ||
raytracing.geodesic_tube_info, | ||
raytracing.geodesics, | ||
raytracing.ideal_raytracing_data, | ||
raytracing.upper_halfspace_utilities | ||
] | ||
|
||
def run_doctests(verbose=False, print_info=False): | ||
globs = {'Manifold': snappy.Manifold} | ||
return testing.doctest_modules(modules, | ||
verbose=verbose, | ||
print_info=print_info, | ||
extraglobs=globs) | ||
|
||
run_doctests.__name__ = raytracing.__name__ | ||
|
||
if __name__ == '__main__': | ||
testing.run_doctests_as_main(run_doctests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.