diff options
| author | Tim Graham <timograham@gmail.com> | 2018-01-04 14:41:38 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-01-04 15:41:33 -0500 |
| commit | 8e1a7dab4b98dee2c696d435ea02f56de6250aa0 (patch) | |
| tree | 484aa0e6600e67efcbc6f832bfecd96867a0535c /tests/test_discovery_sample | |
| parent | d7b2aa24f75434c2ce50100cfef3586071e0747a (diff) | |
Reorganized test_runner test apps.
Diffstat (limited to 'tests/test_discovery_sample')
| -rw-r--r-- | tests/test_discovery_sample/__init__.py | 0 | ||||
| -rw-r--r-- | tests/test_discovery_sample/doctests.py | 46 | ||||
| -rw-r--r-- | tests/test_discovery_sample/empty.py | 0 | ||||
| -rw-r--r-- | tests/test_discovery_sample/pattern_tests.py | 7 | ||||
| -rw-r--r-- | tests/test_discovery_sample/tests/__init__.py | 0 | ||||
| -rw-r--r-- | tests/test_discovery_sample/tests/tests.py | 7 | ||||
| -rw-r--r-- | tests/test_discovery_sample/tests_sample.py | 46 |
7 files changed, 0 insertions, 106 deletions
diff --git a/tests/test_discovery_sample/__init__.py b/tests/test_discovery_sample/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/test_discovery_sample/__init__.py +++ /dev/null diff --git a/tests/test_discovery_sample/doctests.py b/tests/test_discovery_sample/doctests.py deleted file mode 100644 index 6d9403442c..0000000000 --- a/tests/test_discovery_sample/doctests.py +++ /dev/null @@ -1,46 +0,0 @@ -""" -Doctest example from the official Python documentation. -https://docs.python.org/3/library/doctest.html -""" - - -def factorial(n): - """Return the factorial of n, an exact integer >= 0. - - >>> [factorial(n) for n in range(6)] - [1, 1, 2, 6, 24, 120] - >>> factorial(30) # doctest: +ELLIPSIS - 265252859812191058636308480000000... - >>> factorial(-1) - Traceback (most recent call last): - ... - ValueError: n must be >= 0 - - Factorials of floats are OK, but the float must be an exact integer: - >>> factorial(30.1) - Traceback (most recent call last): - ... - ValueError: n must be exact integer - >>> factorial(30.0) # doctest: +ELLIPSIS - 265252859812191058636308480000000... - - It must also not be ridiculously large: - >>> factorial(1e100) - Traceback (most recent call last): - ... - OverflowError: n too large - """ - - import math - if not n >= 0: - raise ValueError("n must be >= 0") - if math.floor(n) != n: - raise ValueError("n must be exact integer") - if n + 1 == n: # catch a value like 1e300 - raise OverflowError("n too large") - result = 1 - factor = 2 - while factor <= n: - result *= factor - factor += 1 - return result diff --git a/tests/test_discovery_sample/empty.py b/tests/test_discovery_sample/empty.py deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/test_discovery_sample/empty.py +++ /dev/null diff --git a/tests/test_discovery_sample/pattern_tests.py b/tests/test_discovery_sample/pattern_tests.py deleted file mode 100644 index f62a233d75..0000000000 --- a/tests/test_discovery_sample/pattern_tests.py +++ /dev/null @@ -1,7 +0,0 @@ -from unittest import TestCase - - -class Test(TestCase): - - def test_sample(self): - self.assertEqual(1, 1) diff --git a/tests/test_discovery_sample/tests/__init__.py b/tests/test_discovery_sample/tests/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/test_discovery_sample/tests/__init__.py +++ /dev/null diff --git a/tests/test_discovery_sample/tests/tests.py b/tests/test_discovery_sample/tests/tests.py deleted file mode 100644 index 58bd4e7f1e..0000000000 --- a/tests/test_discovery_sample/tests/tests.py +++ /dev/null @@ -1,7 +0,0 @@ -from unittest import TestCase - - -class Test(TestCase): - - def test_sample(self): - pass diff --git a/tests/test_discovery_sample/tests_sample.py b/tests/test_discovery_sample/tests_sample.py deleted file mode 100644 index 694b01ffd4..0000000000 --- a/tests/test_discovery_sample/tests_sample.py +++ /dev/null @@ -1,46 +0,0 @@ -import doctest -from unittest import TestCase - -from django.test import SimpleTestCase, TestCase as DjangoTestCase, tag - -from . import doctests - - -class TestVanillaUnittest(TestCase): - - def test_sample(self): - self.assertEqual(1, 1) - - -class TestDjangoTestCase(DjangoTestCase): - - def test_sample(self): - self.assertEqual(1, 1) - - -class TestZimpleTestCase(SimpleTestCase): - # Z is used to trick this test case to appear after Vanilla in default suite - - def test_sample(self): - self.assertEqual(1, 1) - - -class EmptyTestCase(TestCase): - pass - - -@tag('slow') -class TaggedTestCase(TestCase): - - @tag('fast') - def test_single_tag(self): - self.assertEqual(1, 1) - - @tag('fast', 'core') - def test_multiple_tags(self): - self.assertEqual(1, 1) - - -def load_tests(loader, tests, ignore): - tests.addTests(doctest.DocTestSuite(doctests)) - return tests |
