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

15 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-03-07 05:42 +0000

1from pathlib import Path 1hijklmn

2 

3from ...conftest import coverage_run 1hijklmn

4 

5 

6def test_create_db_and_table(cov_tmp_path: Path): 1hijklmn

7 module = "docs_src.tutorial.create_db_and_table.tutorial001" 1abcdefg

8 result = coverage_run(module=module, cwd=cov_tmp_path) 1abcdefg

9 assert "BEGIN" in result.stdout 1abcdefg

10 assert 'PRAGMA main.table_info("hero")' in result.stdout 1abcdefg

11 assert "CREATE TABLE hero (" in result.stdout 1abcdefg

12 assert "id INTEGER NOT NULL," in result.stdout 1abcdefg

13 assert "name VARCHAR NOT NULL," in result.stdout 1abcdefg

14 assert "secret_name VARCHAR NOT NULL," in result.stdout 1abcdefg

15 assert "age INTEGER," in result.stdout 1abcdefg

16 assert "PRIMARY KEY (id)" in result.stdout 1abcdefg

17 assert ")" in result.stdout 1abcdefg

18 assert "COMMIT" in result.stdout 1abcdefg