nedbat / coveragepy

The code coverage tool for Python
https://coverage.readthedocs.io
Apache License 2.0
3.03k stars 435 forks source link

Playwright tests remain uncovered #1864

Open AlmerCarbonEquity opened 1 month ago

AlmerCarbonEquity commented 1 month ago

Describe the bug

Playwright tests don't have full coverage in the coverage report, even though the code is run.

To Reproduce

  1. What version of Python are you using?
  2. 3.12
  3. What version of coverage.py shows the problem? The output of coverage debug sys is helpful.
  4. 
               coverage_version: 7.6.1
                coverage_module: /Users/almerstaal/.pyenv/versions/3.12.0/lib/python3.12/site-packages/coverage/__init__.py
                           core: -none-
                        CTracer: available
           plugins.file_tracers: -none-
            plugins.configurers: -none-
      plugins.context_switchers: -none-
              configs_attempted: /Users/almerstaal/Repos/playwright-bug/.coveragerc
                                 /Users/almerstaal/Repos/playwright-bug/setup.cfg
                                 /Users/almerstaal/Repos/playwright-bug/tox.ini
                                 /Users/almerstaal/Repos/playwright-bug/pyproject.toml
                   configs_read: -none-
                    config_file: None
                config_contents: -none-
                      data_file: -none-
                         python: 3.12.0 (main, Oct 31 2023, 20:27:46) [Clang 15.0.0 (clang-1500.0.40.1)]
                       platform: macOS-15.0-arm64-arm-64bit
                 implementation: CPython
                    gil_enabled: True
                     executable: /Users/almerstaal/.pyenv/versions/3.12.0/bin/python3.12
                   def_encoding: utf-8
                    fs_encoding: utf-8
                            pid: 5457
                            cwd: /Users/almerstaal/Repos/playwright-bug
                           path: /Users/almerstaal/.pyenv/versions/3.12.0/bin
                                 /Users/almerstaal/.pyenv/versions/3.12.0/lib/python312.zip
                                 /Users/almerstaal/.pyenv/versions/3.12.0/lib/python3.12
                                 /Users/almerstaal/.pyenv/versions/3.12.0/lib/python3.12/lib-dynload
                                 /Users/almerstaal/.pyenv/versions/3.12.0/lib/python3.12/site-packages
                    environment: HOME = /Users/almerstaal
                                 PYENV_DIR = /Users/almerstaal/Repos/playwright-bug
                                 PYENV_HOOK_PATH = /Users/almerstaal/.pyenv/pyenv.d:/opt/homebrew/Cellar/pyenv/2.4.12/pyenv.d:/usr/etc/pyenv.d:/opt/homebrew/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks
                                 PYENV_ROOT = /Users/almerstaal/.pyenv
                                 PYENV_SHELL = zsh
                                 PYENV_VERSION = 3.12.0
                                 VIRTUALENVWRAPPER_PYTHON = /Users/almerstaal/.pyenv/versions/3.11.2/bin/python3
                   command_line: /Users/almerstaal/.pyenv/versions/3.12.0/bin/coverage debug sys
         sqlite3_sqlite_version: 3.43.2
             sqlite3_temp_store: 0
        sqlite3_compile_options: ATOMIC_INTRINSICS=1, BUG_COMPATIBLE_20160819, CCCRYPT256,
                                 COMPILER=clang-16.0.0, DEFAULT_AUTOVACUUM, DEFAULT_CACHE_SIZE=2000,
                                 DEFAULT_CKPTFULLFSYNC, DEFAULT_FILE_FORMAT=4,
                                 DEFAULT_JOURNAL_SIZE_LIMIT=32768, DEFAULT_LOOKASIDE=1200,102,
                                 DEFAULT_MEMSTATUS=0, DEFAULT_MMAP_SIZE=0, DEFAULT_PAGE_SIZE=4096,
                                 DEFAULT_PCACHE_INITSZ=20, DEFAULT_RECURSIVE_TRIGGERS,
                                 DEFAULT_SECTOR_SIZE=4096, DEFAULT_SYNCHRONOUS=2,
                                 DEFAULT_WAL_AUTOCHECKPOINT=1000, DEFAULT_WAL_SYNCHRONOUS=1,
                                 DEFAULT_WORKER_THREADS=0, DQS=3, ENABLE_API_ARMOR, ENABLE_BYTECODE_VTAB,
                                 ENABLE_COLUMN_METADATA, ENABLE_DBSTAT_VTAB, ENABLE_FTS3,
                                 ENABLE_FTS3_PARENTHESIS, ENABLE_FTS3_TOKENIZER, ENABLE_FTS4, ENABLE_FTS5,
                                 ENABLE_LOCKING_STYLE=1, ENABLE_MATH_FUNCTIONS, ENABLE_NORMALIZE,
                                 ENABLE_PREUPDATE_HOOK, ENABLE_RTREE, ENABLE_SESSION, ENABLE_SNAPSHOT,
                                 ENABLE_SQLLOG, ENABLE_STMT_SCANSTATUS, ENABLE_UNKNOWN_SQL_FUNCTION,
                                 ENABLE_UPDATE_DELETE_LIMIT, HAS_CODEC_RESTRICTED, HAVE_ISNAN,
                                 MALLOC_SOFT_LIMIT=1024, MAX_ATTACHED=10, MAX_COLUMN=2000,
                                 MAX_COMPOUND_SELECT=500, MAX_DEFAULT_PAGE_SIZE=8192, MAX_EXPR_DEPTH=1000,
                                 MAX_FUNCTION_ARG=127, MAX_LENGTH=2147483645, MAX_LIKE_PATTERN_LENGTH=50000,
                                 MAX_MMAP_SIZE=1073741824, MAX_PAGE_COUNT=1073741823, MAX_PAGE_SIZE=65536,
                                 MAX_SQL_LENGTH=1000000000, MAX_TRIGGER_DEPTH=1000,
                                 MAX_VARIABLE_NUMBER=500000, MAX_VDBE_OP=250000000, MAX_WORKER_THREADS=8,
                                 MUTEX_UNFAIR, OMIT_AUTORESET, OMIT_LOAD_EXTENSION, STMTJRNL_SPILL=131072,
                                 SYSTEM_MALLOC, TEMP_STORE=1, THREADSAFE=2, USE_URI ```
  5. What versions of what packages do you have installed? The output of pip freeze is helpful.
  6. certifi==2024.8.30 charset-normalizer==3.3.2 greenlet==3.0.3 idna==3.10 iniconfig==2.0.0 packaging==24.1 playwright==1.47.0 pluggy==1.5.0 pyee==12.0.0 pytest==8.3.3 pytest-base-url==2.1.0 pytest-playwright==0.5.2 python-slugify==8.0.4 requests==2.32.3 text-unidecode==1.3 typing_extensions==4.12.2 urllib3==2.2.3

  7. What code shows the problem? Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix.
  8. https://github.com/AlmerCarbonEquity/playwright-bug/commits/master/ with commit: 08d57d919d6902e01a5d72af90da06ff71452407
  9. What commands should we run to reproduce the problem? Be specific. Include everything, even git clone, pip install, and so on. Explain like we're five!
  10. git clone https://github.com/AlmerCarbonEquity/playwright-bug.git
  11. pip install -r requirements.txt
  12. coverage run -m pytest
  13. coverage html
  14. open htmlcov/index.html

Expected behavior

I would expect a 100% coverage here.