summaryrefslogtreecommitdiff
path: root/_pytest/main.py
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2013-12-07 16:39:53 +0100
committerholger krekel <holger@merlinux.eu>2013-12-07 16:39:53 +0100
commit426907eafbba7738cf33374a33c3c7aed67dadce (patch)
tree66ad7cf1258ffb9b6fa43cb9af88aa429ecbbe0b /_pytest/main.py
parent4f0879ff9b3e7ad0da1839131c35b4e6412b972f (diff)
downloadpytest-426907eafbba7738cf33374a33c3c7aed67dadce.tar.gz
radically simplify eq/neq with nodes by just using Pythons builtin "is" relationship.
The need for comparing two separately instantiated nodes seems to be historic (related to an already-gone mode of pytest-xdist which would re-collect nodes) and not actually needed anymore.
Diffstat (limited to '_pytest/main.py')
-rw-r--r--_pytest/main.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/_pytest/main.py b/_pytest/main.py
index 75cb487e4..9c7266bfc 100644
--- a/_pytest/main.py
+++ b/_pytest/main.py
@@ -272,21 +272,11 @@ class Node(object):
self._nodeid = x = self._makeid()
return x
-
def _makeid(self):
return self.parent.nodeid + "::" + self.name
- def __eq__(self, other):
- if not isinstance(other, Node):
- return False
- return (self.__class__ == other.__class__ and
- self.name == other.name and self.parent == other.parent)
-
- def __ne__(self, other):
- return not self == other
-
def __hash__(self):
- return hash((self.name, self.parent))
+ return hash(self.nodeid)
def setup(self):
pass