summaryrefslogtreecommitdiff
path: root/tests/test_runner_apps
diff options
context:
space:
mode:
authordjango-bot <ops@djangoproject.com>2022-02-03 20:24:19 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-07 20:37:05 +0100
commit9c19aff7c7561e3a82978a272ecdaad40dda5c00 (patch)
treef0506b668a013d0063e5fba3dbf4863b466713ba /tests/test_runner_apps
parentf68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff)
downloaddjango-9c19aff7c7561e3a82978a272ecdaad40dda5c00.tar.gz
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'tests/test_runner_apps')
-rw-r--r--tests/test_runner_apps/buffer/tests_buffer.py8
-rw-r--r--tests/test_runner_apps/databases/tests.py8
-rw-r--r--tests/test_runner_apps/failures/tests_failures.py2
-rw-r--r--tests/test_runner_apps/sample/doctests.py1
-rw-r--r--tests/test_runner_apps/sample/pattern_tests.py1
-rw-r--r--tests/test_runner_apps/sample/tests/tests.py1
-rw-r--r--tests/test_runner_apps/sample/tests_sample.py5
-rw-r--r--tests/test_runner_apps/simple/tests.py9
-rw-r--r--tests/test_runner_apps/tagged/tests.py7
-rw-r--r--tests/test_runner_apps/tagged/tests_inheritance.py10
10 files changed, 21 insertions, 31 deletions
diff --git a/tests/test_runner_apps/buffer/tests_buffer.py b/tests/test_runner_apps/buffer/tests_buffer.py
index 36bc315d6d..00d959cd49 100644
--- a/tests/test_runner_apps/buffer/tests_buffer.py
+++ b/tests/test_runner_apps/buffer/tests_buffer.py
@@ -4,11 +4,11 @@ from unittest import TestCase
class WriteToStdoutStderrTestCase(TestCase):
def test_pass(self):
- sys.stderr.write('Write to stderr.')
- sys.stdout.write('Write to stdout.')
+ sys.stderr.write("Write to stderr.")
+ sys.stdout.write("Write to stdout.")
self.assertTrue(True)
def test_fail(self):
- sys.stderr.write('Write to stderr.')
- sys.stdout.write('Write to stdout.')
+ sys.stderr.write("Write to stderr.")
+ sys.stdout.write("Write to stdout.")
self.assertTrue(False)
diff --git a/tests/test_runner_apps/databases/tests.py b/tests/test_runner_apps/databases/tests.py
index dbb3b46e0b..b3c85564a1 100644
--- a/tests/test_runner_apps/databases/tests.py
+++ b/tests/test_runner_apps/databases/tests.py
@@ -7,17 +7,17 @@ class NoDatabaseTests(unittest.TestCase):
class DefaultDatabaseTests(NoDatabaseTests):
- databases = {'default'}
+ databases = {"default"}
class DefaultDatabaseSerializedTests(NoDatabaseTests):
- databases = {'default'}
+ databases = {"default"}
serialized_rollback = True
class OtherDatabaseTests(NoDatabaseTests):
- databases = {'other'}
+ databases = {"other"}
class AllDatabasesTests(NoDatabaseTests):
- databases = '__all__'
+ databases = "__all__"
diff --git a/tests/test_runner_apps/failures/tests_failures.py b/tests/test_runner_apps/failures/tests_failures.py
index 0483fcd0f1..dad875b8a6 100644
--- a/tests/test_runner_apps/failures/tests_failures.py
+++ b/tests/test_runner_apps/failures/tests_failures.py
@@ -8,7 +8,7 @@ class FailureTestCase(TestCase):
class ErrorTestCase(TestCase):
def test_sample(self):
- raise Exception('test')
+ raise Exception("test")
class ExpectedFailureTestCase(TestCase):
diff --git a/tests/test_runner_apps/sample/doctests.py b/tests/test_runner_apps/sample/doctests.py
index 8707ecaf86..a657d9bdf3 100644
--- a/tests/test_runner_apps/sample/doctests.py
+++ b/tests/test_runner_apps/sample/doctests.py
@@ -32,6 +32,7 @@ def factorial(n):
"""
import math
+
if not n >= 0:
raise ValueError("n must be >= 0")
if math.floor(n) != n:
diff --git a/tests/test_runner_apps/sample/pattern_tests.py b/tests/test_runner_apps/sample/pattern_tests.py
index f62a233d75..4500eacb8e 100644
--- a/tests/test_runner_apps/sample/pattern_tests.py
+++ b/tests/test_runner_apps/sample/pattern_tests.py
@@ -2,6 +2,5 @@ from unittest import TestCase
class Test(TestCase):
-
def test_sample(self):
self.assertEqual(1, 1)
diff --git a/tests/test_runner_apps/sample/tests/tests.py b/tests/test_runner_apps/sample/tests/tests.py
index 58bd4e7f1e..a9faf514f2 100644
--- a/tests/test_runner_apps/sample/tests/tests.py
+++ b/tests/test_runner_apps/sample/tests/tests.py
@@ -2,6 +2,5 @@ from unittest import TestCase
class Test(TestCase):
-
def test_sample(self):
pass
diff --git a/tests/test_runner_apps/sample/tests_sample.py b/tests/test_runner_apps/sample/tests_sample.py
index eb977e44fb..6e876ebd41 100644
--- a/tests/test_runner_apps/sample/tests_sample.py
+++ b/tests/test_runner_apps/sample/tests_sample.py
@@ -1,19 +1,18 @@
import doctest
from unittest import TestCase
-from django.test import SimpleTestCase, TestCase as DjangoTestCase
+from django.test import SimpleTestCase
+from django.test import TestCase as DjangoTestCase
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)
diff --git a/tests/test_runner_apps/simple/tests.py b/tests/test_runner_apps/simple/tests.py
index edd822737c..62611bee32 100644
--- a/tests/test_runner_apps/simple/tests.py
+++ b/tests/test_runner_apps/simple/tests.py
@@ -1,10 +1,10 @@
from unittest import TestCase
-from django.test import SimpleTestCase, TestCase as DjangoTestCase
+from django.test import SimpleTestCase
+from django.test import TestCase as DjangoTestCase
class DjangoCase1(DjangoTestCase):
-
def test_1(self):
pass
@@ -13,7 +13,6 @@ class DjangoCase1(DjangoTestCase):
class DjangoCase2(DjangoTestCase):
-
def test_1(self):
pass
@@ -22,7 +21,6 @@ class DjangoCase2(DjangoTestCase):
class SimpleCase1(SimpleTestCase):
-
def test_1(self):
pass
@@ -31,7 +29,6 @@ class SimpleCase1(SimpleTestCase):
class SimpleCase2(SimpleTestCase):
-
def test_1(self):
pass
@@ -40,7 +37,6 @@ class SimpleCase2(SimpleTestCase):
class UnittestCase1(TestCase):
-
def test_1(self):
pass
@@ -49,7 +45,6 @@ class UnittestCase1(TestCase):
class UnittestCase2(TestCase):
-
def test_1(self):
pass
diff --git a/tests/test_runner_apps/tagged/tests.py b/tests/test_runner_apps/tagged/tests.py
index d3742b3749..7b61b9321e 100644
--- a/tests/test_runner_apps/tagged/tests.py
+++ b/tests/test_runner_apps/tagged/tests.py
@@ -3,13 +3,12 @@ from unittest import TestCase
from django.test import tag
-@tag('slow')
+@tag("slow")
class TaggedTestCase(TestCase):
-
- @tag('fast')
+ @tag("fast")
def test_single_tag(self):
self.assertEqual(1, 1)
- @tag('fast', 'core')
+ @tag("fast", "core")
def test_multiple_tags(self):
self.assertEqual(1, 1)
diff --git a/tests/test_runner_apps/tagged/tests_inheritance.py b/tests/test_runner_apps/tagged/tests_inheritance.py
index 59e564202d..80545c9125 100644
--- a/tests/test_runner_apps/tagged/tests_inheritance.py
+++ b/tests/test_runner_apps/tagged/tests_inheritance.py
@@ -3,27 +3,25 @@ from unittest import TestCase
from django.test import tag
-@tag('foo')
+@tag("foo")
class FooBase(TestCase):
pass
class Foo(FooBase):
-
def test_no_new_tags(self):
pass
- @tag('baz')
+ @tag("baz")
def test_new_func_tag(self):
pass
-@tag('bar')
+@tag("bar")
class FooBar(FooBase):
-
def test_new_class_tag_only(self):
pass
- @tag('baz')
+ @tag("baz")
def test_new_class_and_func_tags(self):
pass