GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — deepdiff/tests/__init__.py at master · benthomasson/deepdiff

Expand file tree

/

__init__.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
60 lines (44 loc) · 1.62 KB
/

__init__.py

Copy path

File metadata and controls

60 lines (44 loc) · 1.62 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
def parameterize_cases(argnames, cases):
"""
This is used for parametrizing pytest test cases.
argnames: a comma separated string of arguments that the test expects.
cases: a dictionary of test cases.
"""
argnames_list = [i.strip() for i in argnames.split(',')]
argvalues = [tuple(i[k] for k in argnames_list) for i in cases.values()]
ids = list(cases.keys())
return {'argnames': argnames, 'argvalues': argvalues, 'ids': ids}
class CustomClass:
def __init__(self, a, b=None):
self.a = a
self.b = b
def __str__(self):
return "Custom({}, {})".format(self.a, self.b)
def __repr__(self):
return self.__str__()
class CustomClassMisleadingRepr(CustomClass):
def __str__(self):
return "({}, {})".format(self.a, self.b)
class CustomClass2:
def __init__(self, prop1=None, prop2=None):
self.prop1 = prop1 or []
self.prop2 = prop2 or []
def __eq__(self, other):
return self.__dict__ == other.__dict__
def __repr__(self):
return "<CustomClass2 id: {}, prop1: {}, prop2: {}>".format(
id(self), self.prop1, self.prop2)
__str__ = __repr__
class PicklableClass:
def __init__(self, item):
if item != 'delete':
self.item = item
def __reduce__(self):
if hasattr(self, 'item'):
item = self.item
else:
item = 'delete'
return (self.__class__, (item, ))
def __eq__(self, other):
both_no_items_attr = (not hasattr(self, 'item')) and (not hasattr(other, 'item'))
return both_no_items_attr or self.item == other.item
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.