summaryrefslogtreecommitdiff
path: root/tests/functional/n/nan_comparison_check.py
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2021-12-13 15:59:04 +0100
committerGitHub <noreply@github.com>2021-12-13 15:59:04 +0100
commitbf5217819adbb71bc2c873efa2efb298d12f4731 (patch)
treeeda923fed6483fbae0149ecfc1f61d2543c8f024 /tests/functional/n/nan_comparison_check.py
parente5cb38f991bf1e9ff5aa7c7f4c81880b6ea08f26 (diff)
downloadpylint-git-bf5217819adbb71bc2c873efa2efb298d12f4731.tar.gz
Move tests from ``TestComparison`` to functional tests (#5520)
* Remove some redundant tests
Diffstat (limited to 'tests/functional/n/nan_comparison_check.py')
-rw-r--r--tests/functional/n/nan_comparison_check.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/functional/n/nan_comparison_check.py b/tests/functional/n/nan_comparison_check.py
index b9a720b9a..99b921cde 100644
--- a/tests/functional/n/nan_comparison_check.py
+++ b/tests/functional/n/nan_comparison_check.py
@@ -2,10 +2,12 @@
# pylint: disable=literal-comparison,comparison-with-itself, import-error
"""Test detection of NaN value comparison."""
import numpy
+
x = 42
a = x is numpy.NaN # [nan-comparison]
b = x == numpy.NaN # [nan-comparison]
-c = x == float('nan') # [nan-comparison]
+c = x == float("nan") # [nan-comparison]
+d = x is float("nan") # [nan-comparison]
e = numpy.NaN == numpy.NaN # [nan-comparison]
f = x is 1
g = 123 is "123"
@@ -13,9 +15,10 @@ h = numpy.NaN is not x # [nan-comparison]
i = numpy.NaN != x # [nan-comparison]
j = x != numpy.NaN # [nan-comparison]
-j1 = x != float('nan') # [nan-comparison]
+j1 = x != float("nan") # [nan-comparison]
+k = x is not numpy.NaN # [nan-comparison]
assert x == numpy.NaN # [nan-comparison]
-assert x is not float('nan') # [nan-comparison]
+assert x is not float("nan") # [nan-comparison]
if x == numpy.NaN: # [nan-comparison]
pass
z = bool(x is numpy.NaN) # [nan-comparison]