Home
last modified time | relevance | path

Searched refs:__name__ (Results 1 – 25 of 2347) sorted by relevance

12345678910>>...94

/third_party/python/Lib/unittest/test/testmock/
Dtestwith.py19 with patch('%s.something' % __name__, sentinel.Something2):
26 with patch('%s.something' % __name__, sentinel.Something2):
33 with patch('%s.something' % __name__) as mock_something:
51 …with patch('%s.something' % __name__) as mock_something, patch('%s.something_else' % __name__) as …
61 with patch('%s.something' % __name__, sentinel.Patched) as mock_something:
90 with patch('%s.something' % __name__, sentinel.Patched) as mock_something:
93 with patch('%s.something' % __name__) as mock_again:
103 with patch('%s.something' % __name__) as mock_something:
106 with patch('%s.something_else' % __name__) as mock_something_else:
146 with patch('%s.open' % __name__, mock, create=True) as patched:
[all …]
Dtestcallable.py27 self.assertIn(mock.__class__.__name__, repr(mock))
58 patcher = patch('%s.X' % __name__, spec=True)
70 patcher = patch('%s.X' % __name__, spec_set=True)
82 patcher = patch('%s.X' % __name__, spec=X())
91 patcher = patch('%s.X' % __name__, spec_set=X())
111 with patch('%s.X' % __name__, **{arg: Klass}) as mock:
149 if __name__ == "__main__":
Dtestpatch.py23 PTModule = sys.modules[__name__]
24 MODNAME = '%s.PTModule' % __name__
61 foo_name = '%s.Foo' % __name__
150 @patch('%s.something' % __name__, sentinel.Something2)
163 @patch('%s.something' % __name__, sentinel.Something2)
172 @patch('%s.something' % __name__, sentinel.Something2)
173 @patch('%s.something_else' % __name__, sentinel.SomethingElse)
206 @patch('%s.SomeClass.class_attribute' % __name__,
260 @patch('%s.SomeClass' % __name__, spec=SomeClass)
282 @patch('%s.SomeClass' % __name__, spec=['wibble'])
[all …]
/third_party/python/Lib/test/test_importlib/import_/
Dtest_fromlist.py23 self.assertEqual(module.__name__, 'pkg')
30 self.assertEqual(module.__name__, 'pkg.module')
58 self.assertEqual(module.__name__, 'module')
65 self.assertEqual(module.__name__, 'module')
73 self.assertEqual(module.__name__, 'pkg')
75 self.assertEqual(module.module.__name__, 'pkg.module')
81 self.assertEqual(module.__name__, 'pkg')
101 self.assertEqual(module.__name__, 'pkg.mod')
109 self.assertEqual(module.__name__, 'pkg')
111 self.assertEqual(module.module.__name__, 'pkg.module')
[all …]
Dtest_relative_imports.py83 self.assertEqual(module.__name__, 'pkg')
96 self.assertEqual(module.__name__, 'pkg.mod2')
109 self.assertEqual(module.__name__, 'pkg')
121 self.assertEqual(module.__name__, 'pkg')
133 self.assertEqual(module.__name__, 'pkg')
150 self.assertEqual(module.__name__, 'pkg')
196 self.assertEqual(module.__name__, '__runpy_pkg__.uncle.cousin')
206 self.assertEqual(mod.__name__, 'crash.mod')
232 if __name__ == '__main__':
Dtest___package__.py49 self.assertEqual(module.__name__, 'pkg')
57 self.assertEqual(module.__name__, 'pkg')
69 self.assertEqual(module.__name__, 'pkg')
74 self.assertEqual(module.__name__, 'pkg')
187 if __name__ == '__main__':
/third_party/python/Lib/test/
Dtest_pkg.py112 self.assertEqual(t2.__name__, "t2")
113 self.assertEqual(t2.sub.__name__, "t2.sub")
114 self.assertEqual(t2.sub.subsub.__name__, "t2.sub.subsub")
128 self.assertEqual(sub.__name__, "t2.sub")
129 self.assertEqual(subsub.__name__, "t2.sub.subsub")
130 self.assertEqual(sub.subsub.__name__, "t2.sub.subsub")
136 self.assertEqual(t2.__name__, "t2")
137 self.assertEqual(t2.sub.__name__, "t2.sub")
138 self.assertEqual(t2.sub.subsub.__name__, "t2.sub.subsub")
158 self.assertEqual(t3.__name__, "t3")
[all …]
Dtest_baseexception.py19 (ins.__class__.__name__, attr))
27 exc_set.add(object_.__name__)
69 "%s is not a subclass of %s" % (exc.__name__,
70 superclasses[-1][1].__name__))
96 [repr(exc), '%s(%r)' % (exc.__class__.__name__, arg)])
106 [repr(exc), exc.__class__.__name__ + repr(exc.args)])
114 [repr(exc), exc.__class__.__name__ + '()'])
183 if __name__ == '__main__':
Dtest_module.py14 return "<module '{}' (crafted)>".format(m.__name__)
28 s = foo.__name__
53 self.assertEqual(foo.__name__, "foo")
65 self.assertEqual(foo.__name__, "foo")
75 self.assertEqual(foo.__name__, "foo")
88 self.assertEqual(foo.__name__, "foo")
182 del m.__name__
196 del m.__name__
207 del m.__name__
219 del m.__name__
[all …]
Dtest_profile.py104 assert_python_failure('-m', self.profilermodule.__name__, '-m')
107 assert_python_failure('-m', self.profilermodule.__name__,
111 assert_python_ok('-m', self.profilermodule.__name__,
121 '-m', self.profilermodule.__name__,
216 if __name__ == "__main__":
Dtest_funcattrs.py48 self.assertEqual(self.b.__module__, __name__)
115 self.assertEqual(c[0].__class__.__name__, "cell")
158 self.assertEqual(self.b.__name__, 'b')
159 self.b.__name__ = 'c'
160 self.assertEqual(self.b.__name__, 'c')
161 self.b.__name__ = 'd'
162 self.assertEqual(self.b.__name__, 'd')
170 self.assertEqual(self.fi.a.__name__, 'a')
437 if __name__ == "__main__":
/third_party/PyYAML/tests/lib/
Dtest_errors.py10 print("%s:" % exc.__class__.__name__, exc)
22 print("%s:" % exc.__class__.__name__, exc)
34 print("%s:" % exc.__class__.__name__, exc)
47 print("%s:" % exc.__class__.__name__, exc)
62 print("%s:" % exc.__class__.__name__, exc)
68 if __name__ == '__main__':
Dtest_recursive.py12 return "%s(foo=%r, bar=%r)" % (self.__class__.__name__,
15 return "%s(foo=..., bar=...)" % self.__class__.__name__
49 if __name__ == '__main__':
/third_party/python/Doc/library/
D__main__.rst6 interfaces, import-time behavior, and ``__name__ == '__main__'``.
13 checked using the ``__name__ == '__main__'`` expression; and
24 ``__name__ == '__main__'``
27 When a Python module or package is imported, ``__name__`` is set to the
32 >>> configparser.__name__
35 If the file is part of a package, ``__name__`` will also include the parent
39 >>> process.__name__
43 its ``__name__`` is set to the string ``'__main__'``.
57 >>> __name__
97 In each of these situations, the top-level module's ``__name__`` is set to
[all …]
/third_party/python/Lib/test/test_importlib/
Dtest_lazy.py95 self.assertEqual(TestingImporter.mutated_name, module.__name__)
107 module.__name__ = 'bogus'
108 self.assertEqual('bogus', module.__name__)
125 del module.__name__
134 module.__name__
141 module.__name__
144 if __name__ == '__main__':
/third_party/python/Tools/peg_generator/pegen/
Dast_dump.py19 if any(cls.__name__ == "AST" for cls in node.__class__.__mro__):
51 return "%s(%s)" % (node.__class__.__name__, ", ".join(args)), not args
52 return "%s(%s%s)" % (node.__class__.__name__, prefix, sep.join(args)), False
59 if all(cls.__name__ != "AST" for cls in node.__class__.__mro__):
60 raise TypeError("expected AST, got %r" % node.__class__.__name__)
/third_party/protobuf/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/
D__init__.py33 if __name__ != '__main__':
35 __import__('pkg_resources').declare_namespace(__name__)
37 __path__ = __import__('pkgutil').extend_path(__path__, __name__)
/third_party/protobuf/python/google/protobuf/
D__init__.py35 if __name__ != '__main__':
37 __import__('pkg_resources').declare_namespace(__name__)
39 __path__ = __import__('pkgutil').extend_path(__path__, __name__)
/third_party/node/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/
Dxcodeproj_file.py343 "Strong dict for key " + key + " in " + self.__class__.__name__
350 + value.__class__.__name__
354 + self.__class__.__name__
375 raise NotImplementedError(self.__class__.__name__ + " must implement Name")
390 hashables = [self.__class__.__name__]
652 raise TypeError("Can't make " + value.__class__.__name__ + " printable")
751 self._XCKVPrint(file, 3, "isa", self.__class__.__name__)
779 raise KeyError(property + " not in " + self.__class__.__name__)
788 + self.__class__.__name__
790 + value.__class__.__name__
[all …]
/third_party/node/tools/gyp/pylib/gyp/
Dxcodeproj_file.py343 "Strong dict for key " + key + " in " + self.__class__.__name__
350 + value.__class__.__name__
354 + self.__class__.__name__
375 raise NotImplementedError(self.__class__.__name__ + " must implement Name")
390 hashables = [self.__class__.__name__]
652 raise TypeError("Can't make " + value.__class__.__name__ + " printable")
751 self._XCKVPrint(file, 3, "isa", self.__class__.__name__)
779 raise KeyError(property + " not in " + self.__class__.__name__)
788 + self.__class__.__name__
790 + value.__class__.__name__
[all …]
/third_party/python/Lib/
Dpydoc.py105 name = obj.__func__.__name__
114 name = obj.__name__
119 name = obj.__name__
130 name = func.__name__
135 name = obj.__name__
201 name = object.__name__
389 exc = self.exc.__name__
483 name and ' ' + repr(name), type(object).__name__)
500 (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
505 object.__name__ not in ('xml.etree', 'test.pydoc_mod')):
[all …]
Dpprint.py196 cls_name = object.__class__.__name__
227 stream.write(cls.__name__ + '(')
229 indent + len(cls.__name__) + 1, allowance + 1,
261 stream.write(typ.__name__ + '({')
263 indent += len(typ.__name__) + 1
367 cls_name = object.__class__.__name__
475 indent += len(cls.__name__) + 1
476 stream.write('%s(%s,\n%s' % (cls.__name__, rdf, ' ' * indent))
487 stream.write(cls.__name__ + '({')
492 indent + len(cls.__name__) + 1, allowance + 2,
[all …]
Dmodulefinder.py101 self.__name__ = name
114 s = "Module(%r" % (self.__name__,)
186 pname = caller.__name__
210 assert parent.__name__ == pname
226 qname = "%s.%s" % (parent.__name__, head)
250 mname = "%s.%s" % (m.__name__, head)
267 subname = "%s.%s" % (m.__name__, sub)
365 self.badmodules[name][caller.__name__] = 1
440 mm = self.modules.get(m.__name__ + "." + name)
456 self._safe_import_hook(parent.__name__, None, fromlist, level=0)
[all …]
/third_party/python/Lib/test/test_email/
Dtest_parser.py43 with self.subTest(parser=parser.__name__):
75 with self.subTest(parser=parser.__name__):
82 with self.subTest(parser=parser.__name__):
109 if __name__ == '__main__':
/third_party/python/Lib/idlelib/
Dredirector.py50 return "%s(%s<%s>)" % (self.__class__.__name__,
51 self.widget.__class__.__name__,
146 return "%s(%r, %r)" % (self.__class__.__name__,
169 if __name__ == "__main__":

12345678910>>...94