diff options
| author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-03 12:42:06 +0300 |
|---|---|---|
| committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-03 12:42:06 +0300 |
| commit | 70f88456402d7c9bd7a7125980a435a27e41da7d (patch) | |
| tree | c016a46f9452b9244fb11e622f9205b314c1c8f3 | |
| parent | 165da367417b659bfacc2a8018f2198057c54423 (diff) | |
| download | pylint-70f88456402d7c9bd7a7125980a435a27e41da7d.tar.gz | |
Forgot to add tests for the new warnings.
| -rw-r--r-- | pylint/test/functional/duplicate_bases.py | 15 | ||||
| -rw-r--r-- | pylint/test/functional/duplicate_bases.txt | 1 | ||||
| -rw-r--r-- | pylint/test/functional/inconsistent_mro.py | 9 | ||||
| -rw-r--r-- | pylint/test/functional/inconsistent_mro.txt | 1 |
4 files changed, 26 insertions, 0 deletions
diff --git a/pylint/test/functional/duplicate_bases.py b/pylint/test/functional/duplicate_bases.py new file mode 100644 index 0000000..974f975 --- /dev/null +++ b/pylint/test/functional/duplicate_bases.py @@ -0,0 +1,15 @@ +"""Test duplicate bases error."""
+# pylint: disable=missing-docstring,too-few-public-methods,no-init
+
+
+class Duplicates(str, str): # [duplicate-bases]
+ pass
+
+
+class Alpha(str):
+ pass
+
+
+class NotDuplicates(Alpha, str):
+ """The error should not be emitted for this case, since the
+ other same base comes from the ancestors."""
diff --git a/pylint/test/functional/duplicate_bases.txt b/pylint/test/functional/duplicate_bases.txt new file mode 100644 index 0000000..beb91b5 --- /dev/null +++ b/pylint/test/functional/duplicate_bases.txt @@ -0,0 +1 @@ +duplicate-bases:5:Duplicates:Duplicate bases for class 'Duplicates'
\ No newline at end of file diff --git a/pylint/test/functional/inconsistent_mro.py b/pylint/test/functional/inconsistent_mro.py new file mode 100644 index 0000000..0b65068 --- /dev/null +++ b/pylint/test/functional/inconsistent_mro.py @@ -0,0 +1,9 @@ +"""Tests for inconsistent-mro."""
+# pylint: disable=missing-docstring,too-few-public-methods,no-init
+
+class Str(str):
+ pass
+
+
+class Inconsistent(str, Str): # [inconsistent-mro]
+ pass
diff --git a/pylint/test/functional/inconsistent_mro.txt b/pylint/test/functional/inconsistent_mro.txt new file mode 100644 index 0000000..1ae9687 --- /dev/null +++ b/pylint/test/functional/inconsistent_mro.txt @@ -0,0 +1 @@ +inconsistent-mro:8:Inconsistent:Inconsistent method resolution order for class 'Inconsistent' |
