diff options
author | Isaac Burbank <bassmanburbank@gmail.com> | 2018-09-26 11:34:38 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-26 11:34:38 -0600 |
commit | 5bbcdb8a58efd97b0f73927218d5896da67f5203 (patch) | |
tree | ec9dbebafb2b588e11a30463ea1ec4ad238124ac /tensorflow/python/util | |
parent | fa76895ad577246a8ab241e668765cad651558fb (diff) |
Update tf_inspect_test.py
Remove subsection of added tests that were problematic.
Diffstat (limited to 'tensorflow/python/util')
-rw-r--r-- | tensorflow/python/util/tf_inspect_test.py | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/tensorflow/python/util/tf_inspect_test.py b/tensorflow/python/util/tf_inspect_test.py index 55f88f8fc6..ba9430c756 100644 --- a/tensorflow/python/util/tf_inspect_test.py +++ b/tensorflow/python/util/tf_inspect_test.py @@ -353,41 +353,6 @@ class TfInspectTest(test.TestCase): self.assertEqual(argspec, tf_inspect.getfullargspec(partial_function)) - def testGetFullArgSpecOnPartialInvalidFullArgSpec(self): - """Tests getfullargspec. - - Tests on partial function that doesn't have valid fullargspec. - """ - - def func(m, n, l, k=4): - return 2 * m + l + n * k - - partial_func = functools.partial(func, n=7) - - exception_message = (r"Some arguments \['l'\] do not have default value, " - "but they are positioned after those with default " - "values. This can not be expressed with ArgSpec.") - with self.assertRaisesRegexp(ValueError, exception_message): - tf_inspect.getfullargspec(partial_func) - - def testGetFullArgSpecOnPartialValidFullArgSpec(self): - """Tests getfullargspec on partial function with valid fullargspec.""" - - def func(m, n, l, k=4): - return 2 * m + l + n * k - - partial_func = functools.partial(func, n=7, l=2) - argspec = tf_inspect.FullArgSpec( - args=['m', 'n', 'l', 'k'], - varargs=None, - varkw=None, - defaults=(7, 2, 4), - kwonlyargs=[], - kwonlydefaults=None, - annotations={}) - - self.assertEqual(argspec, tf_inspect.getfullargspec(partial_func)) - def testGetFullArgSpecOnPartialNoArgumentsLeft(self): """Tests getfullargspec on partial function that prunes all arguments.""" @@ -401,35 +366,6 @@ class TfInspectTest(test.TestCase): self.assertEqual(argspec, tf_inspect.getfullargspec(partial_func)) - def testGetFullArgSpecOnPartialKeywordArgument(self): - """Tests getfullargspec on partial function that prunes some arguments.""" - - def func(m, n): - return 2 * m + n - - partial_func = functools.partial(func, n=7) - argspec = tf_inspect.FullArgSpec( - args=['m', 'n'], varargs=None, varkw=None, defaults=(7,), - kwonlyargs=[], kwonlydefaults=None, annotations={}) - - self.assertEqual(argspec, tf_inspect.getfullargspec(partial_func)) - - def testGetFullArgSpecOnPartialKeywordArgumentWithDefaultValue(self): - """Tests getfullargspec. - - Tests on partial function that prunes argument by keyword. - """ - - def func(m=1, n=2): - return 2 * m + n - - partial_func = functools.partial(func, n=7) - argspec = tf_inspect.FullArgSpec( - args=['m', 'n'], varargs=None, varkw=None, defaults=(1, 7), - kwonlyargs=[], kwonlydefaults=None, annotations={}) - - self.assertEqual(argspec, tf_inspect.getfullargspec(partial_func)) - def testGetFullArgSpecOnPartialWithVarargs(self): """Tests getfullargspec on partial function with variable arguments.""" @@ -459,20 +395,6 @@ class TfInspectTest(test.TestCase): self.assertEqual(argspec, tf_inspect.getfullargspec(partial_func)) - def testGetFullArgSpecOnPartialWithDecorator(self): - """Tests getfullargspec on decorated partial function.""" - - @test_decorator('decorator') - def func(m=1, n=2): - return 2 * m + n - - partial_func = functools.partial(func, n=7) - argspec = tf_inspect.FullArgSpec( - args=['m', 'n'], varargs=None, varkw=None, defaults=(1, 7), - kwonlyargs=[], kwonlydefaults=None, annotations={}) - - self.assertEqual(argspec, tf_inspect.getfullargspec(partial_func)) - def testGetFullArgSpecOnCallableObject(self): class Callable(object): |