Merge branch 'main' into avm99963-monorail
Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266
GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/testing/test/fake_test.py b/testing/test/fake_test.py
index c098236..a710328 100644
--- a/testing/test/fake_test.py
+++ b/testing/test/fake_test.py
@@ -1,7 +1,6 @@
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file or at
-# https://developers.google.com/open-source/licenses/bsd
+# Copyright 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Tests for the fake module."""
from __future__ import print_function
@@ -9,6 +8,7 @@
from __future__ import absolute_import
import inspect
+import six
import unittest
from services import cachemanager_svc
@@ -44,9 +44,12 @@
to_test = [x for x in both_attrs if '__' not in x]
for name in to_test:
real_attr = getattr(real_cls, name)
- assert inspect.ismethod(real_attr)
- real_spec = inspect.getargspec(real_attr)
- fake_spec = inspect.getargspec(getattr(fake_cls, name))
+ if six.PY2:
+ assert inspect.ismethod(real_attr)
+ else:
+ assert inspect.isfunction(real_attr)
+ real_spec = inspect.getfullargspec(real_attr)
+ fake_spec = inspect.getfullargspec(getattr(fake_cls, name))
# check same number of args and kwargs
real_kw_len = len(real_spec[3]) if real_spec[3] else 0
fake_kw_len = len(fake_spec[3]) if fake_spec[3] else 0