Switch from nose to pytest

This commit is contained in:
Friedrich Lindenberg
2021-10-30 12:07:06 +02:00
parent 63c8357d1b
commit b1638a41d6
6 changed files with 16 additions and 11 deletions
+4 -4
View File
@@ -35,7 +35,7 @@ class DatabaseTestCase(unittest.TestCase):
def test_create_table(self):
table = self.db["foo"]
assert table.table.exists()
assert self.db.has_table(table.table.name)
assert len(table.table.columns) == 1, table.table.columns
assert "id" in table.table.c, table.table.c
@@ -51,7 +51,7 @@ class DatabaseTestCase(unittest.TestCase):
def test_create_table_custom_id1(self):
pid = "string_id"
table = self.db.create_table("foo2", pid, self.db.types.string(255))
assert table.table.exists()
assert self.db.has_table(table.table.name)
assert len(table.table.columns) == 1, table.table.columns
assert pid in table.table.c, table.table.c
table.insert({pid: "foobar"})
@@ -60,7 +60,7 @@ class DatabaseTestCase(unittest.TestCase):
def test_create_table_custom_id2(self):
pid = "string_id"
table = self.db.create_table("foo3", pid, self.db.types.string(50))
assert table.table.exists()
assert self.db.has_table(table.table.name)
assert len(table.table.columns) == 1, table.table.columns
assert pid in table.table.c, table.table.c
@@ -70,7 +70,7 @@ class DatabaseTestCase(unittest.TestCase):
def test_create_table_custom_id3(self):
pid = "int_id"
table = self.db.create_table("foo4", primary_id=pid)
assert table.table.exists()
assert self.db.has_table(table.table.name)
assert len(table.table.columns) == 1, table.table.columns
assert pid in table.table.c, table.table.c