Coverage for tests/test_tutorial/test_create_db_and_table/test_tutorial001_py310.py: 100%

16 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-09 00:02 +0000

1from pathlib import Path 1defghi

2 

3from ...conftest import coverage_run, needs_py310 1defghi

4 

5 

6@needs_py310 1defghi

7def test_create_db_and_table(cov_tmp_path: Path): 1defghi

8 module = "docs_src.tutorial.create_db_and_table.tutorial001_py310" 1abc

9 result = coverage_run(module=module, cwd=cov_tmp_path) 1abc

10 assert "BEGIN" in result.stdout 1abc

11 assert 'PRAGMA main.table_info("hero")' in result.stdout 1abc

12 assert "CREATE TABLE hero (" in result.stdout 1abc

13 assert "id INTEGER NOT NULL," in result.stdout 1abc

14 assert "name VARCHAR NOT NULL," in result.stdout 1abc

15 assert "secret_name VARCHAR NOT NULL," in result.stdout 1abc

16 assert "age INTEGER," in result.stdout 1abc

17 assert "PRIMARY KEY (id)" in result.stdout 1abc

18 assert ")" in result.stdout 1abc

19 assert "COMMIT" in result.stdout 1abc