Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
all: removed old version-dependent tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hercinger Viktor committed Feb 28, 2018
1 parent b21f0d9 commit f666a27
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 56 deletions.
14 changes: 0 additions & 14 deletions typesafety/tests/mockmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,11 @@
import collections

from . import mockmodule2
from .version import is_above_version

# External objects not native to this module
from .externalmodule import UndecoratedClass, undecorated_function


if not is_above_version('3.2'):
class ClassWithSlots:
__slots__ = ['mutable']

@property
def immutable(self):
return 1

@property
def mutable(self):
return 2


def function():
pass

Expand Down
13 changes: 0 additions & 13 deletions typesafety/tests/test_autodecorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import sys
import unittest

from .version import skip_above_version

from ..autodecorator import decorate_module


Expand Down Expand Up @@ -67,17 +65,6 @@ def __unload_test_module(self, name):
if fullname in sys.modules:
del sys.modules[fullname]

@skip_above_version(
"3.2",
"Defining slots this way causes a ValueError, so they become " +
"unreachable for the autodecorator. Every other fix like this " +
"in other software simply removes slot entries " +
"like ClassWithSlots.mutable."
)
def test_immutable_class_attributes_are_not_decorated(self):
self.assertEqual(1, self._module.ClassWithSlots().immutable)
self.assertEqual(1234, self._module.ClassWithSlots().mutable)

def test_dont_decorate_objects_not_native_to_the_module(self):
self.assertEqual(2, self._module.UndecoratedClass().method(1))
self.assertEqual(3, self._module.undecorated_function(1))
29 changes: 0 additions & 29 deletions typesafety/tests/test_sphinxautodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from functools import wraps

from ..sphinxautodoc import add_annotations_to_signature
from .version import skip_above_version, skip_below_or_at_version


# Is a test suite, can have as many public methods as needed.
Expand Down Expand Up @@ -197,20 +196,6 @@ def test_decorated_methods_are_resolved_when_decor_func_attr_is_set(self):
ExampleClass.method_with_decorators
)

@skip_above_version(
"3.3",
"For some reason, version(s) 3.3+ handle annotations of decorated "
"functions differently. In 3.4 this seems to be fixed."
)
def test_decorated_methods_should_not_trigger_inifinite_loop(self):
self.__assert_signature_docs_override(
("(*args, **kwargs)", ""),
"method",
"ExampleClass.method_with_recursive_decorator",
ExampleClass.method_with_recursive_decorator
)

@skip_below_or_at_version("3.3", "See the exact explanation above")
def test_decorated_methods_dont_trigger_inf_loop_but_return_none(self):
self.__assert_signature_docs_override(
None,
Expand All @@ -219,20 +204,6 @@ def test_decorated_methods_dont_trigger_inf_loop_but_return_none(self):
ExampleClass.method_with_recursive_decorator
)

@skip_above_version(
"3.3",
"For some reason, version(s) 3.3+ handle annotations of decorated " +
"functions differently. In 3.4 this seems to be fixed."
)
def test_decorated_methods_should_not_trigger_errors(self):
self.__assert_signature_docs_override(
("(*args, **kwargs)", ""),
"method",
"ExampleClass.method_with_messed_up_decorator",
ExampleClass.method_with_messed_up_decorator
)

@skip_below_or_at_version("3.3", "See the exact explanation above")
def test_decorated_methods_should_not_trigger_errors_but_return_none(self):
self.__assert_signature_docs_override(
None,
Expand Down

0 comments on commit f666a27

Please sign in to comment.